Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding a layout in another layout [duplicate]

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>        

.

like image 537
VK.Dev Avatar asked Jan 25 '11 09:01

VK.Dev


1 Answers

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.

like image 83
Gopinath Avatar answered Sep 17 '22 07:09

Gopinath