一、问题描述 |
在上次博文中,我们使用RadioGroup+ViewPage+Fragmen实现了顶部滑动导航(查看文章:http://blog.youkuaiyun.com/jerehedu/article/details/46911955 ),接下来我们使用FragmentTabHost+Fragment实现底部tab切换,效果如图所示
二、案例主要组件 |
1、MainActivity布局
把整个Activity分成两部TabHost和TabContent,TabHost包含各个tab,tab之间切换将在TabContent所关联的FrameLayout区域中显示各自板块的内容
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" &g