Android???????????????3
???????????? ???????[ 2013/12/23 10:31:28 ] ????????
????????????????MVC?????Android??ó???????????γ????
????????????????????????TabHost?????????Android?????????????????????????Android 4.x?????汾????????TabHost?????????????Fragment??????????????t??ActivityGroup??????
??????????????????????ó???????????????????????????TabHost???????????????????????и?????????????2???5???????????????м???????????????????????????????????Fragmentation???????
?????????????????????????????????????????ɡ?
?????????????Fragment??TabHost?????????????????MainActivity????????????????′??????
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- ???Tab??????????????????????? android:layout_weight="1" -->
<!-- ??????FrameLayout?????λ????д??TabWidget???????? -->
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_gravity="center_horizontal"
android:layout_weight="1">
<fragment
android:id="@+id/j_dynamicFragment"
android:name="com.bjcic.wkj.gui.DynamicFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/j_findFragment"
android:name="com.bjcic.wkj.gui.FindFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/j_shareFragment"
android:name="com.bjcic.wkj.gui.ShareFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/j_snsFragment"
android:name="com.bjcic.wkj.gui.SnsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/j_moreFragment"
android:name="com.bjcic.wkj.gui.MoreFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="60dip"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="-2dp"
android:layout_marginRight="-2dp"
android:background="@null" />
</LinearLayout>
</TabHost>
|
???????????????TabHost?????м??????FrameLayout????????FrameLayout????????????????????????????????????????????Tab??????????Fragment??
????????????MainActivity.onCreate?????????initGui???????????????????????Tab???
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11