I want to show table and below that table i want to show button in center of the table layout, so i wrap the both in linear layout but now it doesn’t display. please help me to solve the problem.
this is my xml layout file=-
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dip"
android:layout_marginTop="30dp"
android:layout_toRightOf="@id/item">
<TableLayout
android:id="@+id/itemTable"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/border"
android:orientation="horizontal"
android:padding="3dip" >
</TableLayout>
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/list_selector"
android:padding="10dp"
android:layout_gravity="center_horizontal"
android:text=" Order " />
</LinearLayout>
Is there a reason why you don’t use a RelativeLayout?
this way it should adapt nicely inside the layout.
If your problem is that you don’t SEE the button,maybe your table is too big?You should make it smaller,or put everything inside a nice ScrollView