In my code, I re-size a bitmap and then use the bitmap in my code using imageView.setImageBitmap(). However, for some reason the image will not be at the top of the layout, rather it ends up in the center of the screen ( http://imageshack.us/photo/my-images/841/ssbluepic.png/ )
Here is the code for my layout file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <TextView android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:id="@+id/textView1"></TextView>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/textView2"></TextView> -->
<ImageView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/imageView1"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"></ImageView>
</RelativeLayout>
(the two TextViews are commented out).
Any help with this would be much appreciated!
I used your XML-file and the following java code. The positioning of the image at the top works fine. Probably something wrong with your java code.