Call an android layout in another one to make a nested layout -
sorry new in android
because of large contents going create scrollview. in way, have created parts of content in 1 file (let's call firstlayout.xml) , other part seconedlayout.xml. going call both of them in single xml file.(parent.xml)
but problem is, don't know, how should call them in scrollview?
here code
firstlayout.xml
<absolutelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > . . . </absolutelayout> seconedlayout.xml is:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > ... </linearlayout> parent.xml
visible
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" > <!-- call firstlayout --> <!-- call secondlayout --> </scrollview>
you can include layout like
<include layout="@layout/firstlayout" /> <include layout="@layout/seconedlayout" /> so layout should like
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <include layout="@layout/firstlayout" /> <include layout="@layout/seconedlayout" /> </linearlayout> </scrollview>
Comments
Post a Comment