学习内容来自“慕课网”

网站上一共有4种方法来实现APP主界面的TAB方法

这里学习第一种

ViewPager实现Tab

布局文件有7个,

主界面acitivity.layout 

 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     xmlns:tools="http://schemas.android.com/tools"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical"
 6      >    
 7     <include layout="@layout/top"/>
 8     
 9      <android.support.v4.view.ViewPager
10          android:id="@+id/id_viewpager"
11         android:layout_width="fill_parent"
12         android:layout_height="0dp"
13         android:layout_weight="1">
14       
15     </android.support.v4.view.ViewPager>
16     
17     <include layout="@layout/bottom"/>
18 </LinearLayout>
19     
activity_main.xml

相关文章:

  • 2021-07-14
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2021-11-05
  • 2021-11-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案