how to add one layout in another layout.I created this layout in tblrow.XML.so i want to add this rows in menu.XML.i want to add this rows depending upon the no of rows.How can i do that.If i add it how can i identify each row.Please help me.I need solution in java not in XML. My Code is
<TableRow android:id="@+id/tblRowMovies" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/btn_backgrnd" android:clickable="true" android:focusable = "true" android:layout_weight="1.0">
<ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/movie" android:layout_gravity="center_vertical|center_horizontal"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="MOVIES" android:layout_gravity="center_vertical" android:paddingLeft="20dp" android:textColor="@android:color/white" android:textSize="20sp" android:textStyle="bold">
</TextView>
.
You can include one layout file in another and this technique is called reusing Android layouts using include tag. e.g:
<include android:id="@+id/myid1" layout="@layout/workspace_screen" />
This is explained well in a blogpost by Android developers..
Yet another article on the Android developer site explains the layout re-usability.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With