tags:

views:

264

answers:

1

The last image button is not being rendered (in fact I see an error which quickly disappears to show the rest of my view minus the last imagebutton.

My activity layout looks like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ScrollView android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF"> <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:stretchColumns="1, 2"> <TableRow> <ImageButton android:background="#ffffff" android:src="@drawable/gettingstarted_cover" android:paddingTop="10px" android:paddingLeft="8px" android:paddingBottom="10px" android:layout_gravity="center_vertical|left"/> <TextView android:text="@string/book_title1" android:textColor="#000000" android:paddingTop="10px" android:paddingLeft="8px" android:layout_gravity="center_vertical|center_horizontal"/> <ImageButton android:src="@drawable/icon_i_page" android:background="#ffffff" android:layout_gravity="center_vertical|right" android:paddingRight="8px"/> </TableRow> <View android:layout_height="1px" android:background="#CCCCCC" /> <TableRow> <ImageButton android:background="#ffffff" android:src="@drawable/underthedome_cover" android:paddingTop="10px" android:paddingLeft="8px" android:paddingBottom="10px" android:layout_gravity="center_vertical|left" /> <TextView android:text="@string/book_title2" android:textColor="#000000" android:paddingTop="10px" android:paddingLeft="8px" android:layout_gravity="center_vertical|center_horizontal" /> <ImageButton android:src="@drawable/icon_i_page" android:background="#ffffff" android:layout_gravity="center_vertical|right" android:paddingRight="8px"/> </TableRow> <View android:layout_height="1px" android:background="#CCCCCC" /> </TableLayout> </ScrollView> <ImageButton android:src="@drawable/free" android:background="#ffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="10px"/> </LinearLayout>

Tried to debug this in Eclipse but didn't find the cause.

+1  A: 

Change you LinearLayout to Relative , android:layout_alignParentTop="true" on your image view. if srcollvew will be covered by imageview , move it after (just in case you're in 1.5) image view, and set android:layout_below="@id/myimagevieid" id on the view has to be set as well by android:id="@+id/myimagevieid"

Alex Volovoy
BTW while you're at it change px to dip in all instances.
Alex Volovoy
Please try formatting the XML at least a little bit before you paste a wall of text and ask a question about it too.
Austyn Mahoney