[英]Robust way to implement “bottom navigation tab bar”
效果是這樣的:
我研究了一些方法。
有人使用radiogroup
,有人使用tabhost
。
最簡單的方法是什么?
還有其他辦法嗎?
谷歌在標簽設計指南中並不是真正推薦的東西,如果您仍然想使用它,我認為TabHost是完美的方法。有關更多信息,請參見如何在屏幕底部對齊 TabHost
<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
</RelativeLayout>
</TabHost>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.