界面布局(二)

ContentFragment的底部导航栏

布局文件FragmentContent.xml

1.LinearLayout的布局,上面是一个viewpager(重载后的Viewpager去掉滑动事件前文又说道),下面是RadioGroup+RadioButton.

2.RadioButton里有个Style,因为几个button的设置有相同的地方,我们就可以这样设置

3.在项目下有个style的包.只是在里面设置button额一些属性

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.ll.view.NoScrollViewPager
        android:id="@+id/vp_content"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

    <RadioGroup
        android:id="@+id/rg_group"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/bottom_tab_bg"
        android:orientation="horizontal"
        android:gravity="center" >

        <RadioButton
            android:id="@+id/rb_home"
            style="@style/Bottom_Tab_Style"
            android:drawableTop="@drawable/tab_home_selector"
            android:checked="true"
            android:text="首页" />

        <RadioButton
             android:id="@+id/rb_news"
            style="@style/Bottom_Tab_Style"
            android:drawableTop="@drawable/tab_news_selector"
            android:text="新闻中心" />

        <RadioButton
             android:id="@+id/rb_smart"
            style="@style/Bottom_Tab_Style"
            android:drawableTop="@drawable/tab_smart_selector"
            android:text="服务中心" />

        <RadioButton
             android:id="@+id/rb_gov"
            style="@style/Bottom_Tab_Style"
            android:drawableTop="@drawable/tab_gov_selector"
            android:text="政务" />

        <RadioButton
             android:id="@+id/rb_setting"
            style="@style/Bottom_Tab_Style"
            android:drawableTop="@drawable/tab_setting_selector"
            android:text="设置" />
    </RadioGroup>

</LinearLayout>





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值