本文结合之前的动态创建fragment来进行一个实践,来实现用Fragment创建一个选项卡本文地址:http://www.cnblogs.com/wuyudong/p/5898075.html ,转载请注明源地址。项目布局<LinearLayout ="ht ...
本文结合之前的动态创建fragment来进行一个实践,来实现用Fragment创建一个选项卡
本文地址:http://www.cnblogs.com/wuyudong/p/5898075.html ,转载请注明源地址。
项目布局
<LinearLayout ="http://schemas.android.com/apk/res/android" ="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:id="@+id/tab1" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="社会新闻" /> <TextView android:id="@+id/tab2" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="生活新闻" /> <TextView android:id="@+id/tab3" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="军事新闻" /> <TextView android:id="@+id/tab4" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="娱乐新闻" /> </LinearLayout> <LinearLayout android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" > </LinearLayout></LinearLayout>
原标题:Android 用Fragment创建一个选项卡
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。