今天产品提了新的需求,其实现在我维护的项目的首页不支持中间凸起的,他动态用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>
android中radioButton+fragment实现底部中间凸起导航
最新推荐文章于 2022-05-26 16:02:52 发布