你的位置:首页 > 软件开发 > 操作系统 > Android典型界面设计——ViewPage+Fragment实现区域顶部tab滑动切换

Android典型界面设计——ViewPage+Fragment实现区域顶部tab滑动切换

发布时间:2015-07-16 15:00:09
一、问题描述  本系列将结合案例应用,陆续向大家介绍一些Android典型界面的设计,首先说说tab导航,导航分为一层和两层(底部区块+区域内头部导航),主要实现方案有RadioGroup+ViewPage+Fragment、Viewpager Indicator、ActionB ...

Android典型界面设计——ViewPage+Fragment实现区域顶部tab滑动切换

一、问题描述

  本系列将结合案例应用,陆续向大家介绍一些Android典型界面的设计,首先说说tab导航,导航分为一层和两层(底部区块+区域内头部导航),主要实现方案有RadioGroup+ViewPage+Fragment、Viewpager Indicator、ActionBar Tabs、FragmentTabHost+Fragment等,下面我们先采用RadioGroup+ViewPage+Fragment实现区域头部导航。

  如图所示:

Android典型界面设计——ViewPage+Fragment实现区域顶部tab滑动切换

二、案例主要组件

  1、先看一下MainActivity布局

 <LinearLayout ="http://schemas.android.com/apk/res/android"  android:layout_width="match_parent"  android:layout_height="match_parent"  android:orientation="vertical" >   <HorizontalScrollView    android:id="@+id/hvChannel"     android:layout_width="match_parent"    android:layout_height="wrap_content"    android:scrollbars="none"    >    <RadioGroup     android:id="@+id/rgChannel"     android:layout_width="wrap_content"    android:layout_height="wrap_content" android:orientation="horizontal">          </RadioGroup>   </HorizontalScrollView>   <android.support.v4.view.ViewPager       android:id="@+id/vpNewsList"        android:layout_width="match_parent"    android:layout_height="0dp"    android:layout_weight="1"     >   </android.support.v4.view.ViewPager></LinearLayout>      


原标题:Android典型界面设计——ViewPage+Fragment实现区域顶部tab滑动切换

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录