android中radioButton+fragment实现底部中间凸起导航

  今天产品提了新的需求,其实现在我维护的项目的首页不支持中间凸起的,他动态用tabHost实现的,但是现在需求涉及到很多需要改动的地方,tabhost维护实在是麻烦,所以,果断改成radioButton+fragment实现 。。。。。  

<RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:background="#fff">

            <FrameLayout
                android:id="@+id/home_replace_flyt"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_above="@+id/hello">

            </FrameLayout>

<LinearLayout
    android:id="@+id/hello"
    android:layout_above="@+id/home_rgp"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:orientation="horizontal">

</LinearLayout>
            <RadioGroup
                android:id="@+id/home_rgp"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:layout_alignParentBottom="true"
                android:background="@color/nga_darker_common_bg"
                android:orientation="horizontal"
                >
                <RadioButton
                    android:id="@+id/home_page_rbtn"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:checked="true"
                    android:drawableTop="@drawable/btn_homepage_selector"
                    android:gravity="center"
                    android:layout_marginLeft="5dp"
                    android:text="@string/home_page_strg"
                    android:drawablePadding="2dp"
                    android:textColor="@color/color_white_selector"
                    android:textSize="@dimen/text_12" />

                <RadioButton
                    android:id="@+id/home_recommend_rbtn"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:drawableTop="@drawable/btn_tab_recommend_selector"
                    android:gravity="center"
                    android:text="@string/nga_recommend"
                    android:drawablePadding="2dp"
                    android:textColor="@color/color_white_selector"
                    android:textSize="@dimen/text_12" />
                <RadioButton
                    android:id="@+id/home_active_rbtn"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:button="@null"
                    android:clipChildren="true"
                    android:singleLine="true"
                    android:gravity="center|bottom"
                    android:textColor="@color/color_white_selector"
                    android:textSize="@dimen/text_12" />

                <RadioButton
                    android:id="@+id/home_grade_rbtn"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:drawableTop="@drawable/btn_tab_grade_selector"
                    android:gravity="center"
                    android:text="@string/grade"
                    android:drawablePadding="2dp"
                    android:textColor="@color/color_white_selector"
                    android:textSize="@dimen/text_12"  />

                <RadioButton
                    android:id="@+id/home_forum_rbtn"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:drawablePadding="2dp"
                    android:drawableTop="@drawable/btn_tab_forum_selector"
                    android:gravity="center"
                    android:text="@string/nga_forum"
                    android:textColor="@color/color_white_selector"
                    android:textSize="@dimen/text_12"
                    android:layout_marginRight="5dp"/>
            </RadioGroup>

            <ImageView
                android:id="@+id/home_azls_iv"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:layout_marginBottom="5dp"
                android:src="@drawable/azls_bottom_icon" />
        </RelativeLayout>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值