欢迎大家在这里学习Activity的Layout文件中声明fragment!下面是我们给大家整理出来的精彩内容。希望大家在这里学习!
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <fragment android:name="com.example.news.ArticleListFragment"
- android:id="@+id/list"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="match_parent" />
- <fragment android:name="com.example.news.ArticleReaderFragment"
- android:id="@+id/viewer"
- android:layout_weight="2"
- android:layout_width="0dp"
- android:layout_height="match_parent" />
- </LinearLayout>
好了,Activity的Layout文件中声明fragment内容就给大家介绍到这里了。希望大家继续关注我们的网站!
相关推荐:
Android Handler的使用介绍