导航--XML文件

前端之家收集整理的这篇文章主要介绍了导航--XML文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
    <FrameLayout  android:id="@+id/containerMain" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/rgMainBottomNav">

    </FrameLayout>

    <RadioGroup  android:id="@+id/rgMainBottomNav" android:layout_width="match_parent" android:layout_height="@dimen/dp66" android:layout_alignParentBottom="true" android:orientation="horizontal">
        <RadioButton  style="@style/BottomNavBarOfMain" android:text="一" android:paddingTop="10dp" android:background="@drawable/six_main_nav_btn_sel" android:id="@+id/rbRecodeModuleMain" android:drawableTop="@drawable/six_main_record" />
        <RadioButton  android:text="二" style="@style/BottomNavBarOfMain" android:paddingTop="10dp" android:background="@drawable/six_main_nav_btn_sel" android:drawableTop="@drawable/six_main_team" android:id="@+id/rbTeamModuleMain" />
        <RadioButton  android:text="三" style="@style/BottomNavBarOfMain" android:paddingTop="10dp" android:background="@drawable/six_main_nav_btn_sel" android:drawableTop="@drawable/six_main_find" android:id="@+id/rbFindModuleMain" />
        <RadioButton  android:text="四" style="@style/BottomNavBarOfMain" android:paddingTop="10dp" android:background="@drawable/six_main_nav_btn_sel" android:drawableTop="@drawable/six_main_mine" android:id="@+id/rbMineModuleMain"/>
    </RadioGroup>
</RelativeLayout>

效果

style代码:

<!--nav bar of bottom in main activity -->
    <style name="BottomNavBarOfMain">
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_height">match_parent</item>
        <item name="android:button">@null</item>
        <item name="android:layout_weight">1</item>
        <item name="android:gravity">center</item>

    </style>

猜你在找的XML相关文章