Hi I would like to align an ImageView with the very bottom of the screen. I've used android:layout_gravity="bottom", and another element with android:layout_weight="1" to push the ImageView down to the bottom.
My XML code below works nicely in landscape - the image is flush with the bottom of the screen. However, in portrait the image is always about 1cm above the bottom of the screen - this is the case even if the page is quite long and you have to scroll down to get to the image. What am I doing wrong? I've also tried using a RelativeLayout and layout_alignParentBottom="true" but that doesn't seem to make any difference. Can anyone help? I'm baffled! Thanks, Anna -------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="10dip"> <Button android:id="@+id/camera_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Take photo" android:drawableRight="@drawable/add" android:paddingRight="10dip" android:paddingLeft="10dip" /> <Button android:id="@+id/details_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Add details" android:drawableRight="@drawable/add" android:paddingRight="10dip" android:paddingLeft="10dip" /> <Button android:id="@+id/report_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Report" android:paddingRight="10dip" android:paddingLeft="10dip" /> <TextView android:id="@+id/empty_text" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text=" " /> <ImageView android:id="@+id/background_image" android:layout_width="fill_parent" android:layout_gravity="bottom" android:layout_height="wrap_content" android:src="@drawable/street_background"></ImageView> </LinearLayout> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---