开发者

New Layout between the existing layout

I have made one Layout in which I want to set the another layout from the existing xml file. Is this possible?

See below code:

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TextView 
            android:id="@+id/textview1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:text="this is a tab" />
        <TextView 
            android:id="@+id/textview2"
            android:layo开发者_如何学JAVAut_width="fill_parent"
            android:layout_height="fill_parent" 
            android:text="this is another tab" />
        <TextView 
            android:id="@+id/textview3"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:text="this is a third tab" />
    </FrameLayout>
</LinearLayout>

Now I want to set the Layout in the frameLayout` how it this possible?

Thanks.


Just create another activity with your second layout and then start the second activity with startActivity().


You didn't provide any code, but if you have 2 layouts in xml and the first one should include the second one, use the include-tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜