Bottom navigation bar —– fragmenttabhost
•
Android
1. Add a parent container on the main interface: fragmenttabhost
属于v4兼容包
需要指定该id为android:id/tabhost,不能修改,表示由android系统来托管这个id。
本身是一个FrameLayout的子类
2. Display content area
作为每选一个导航按钮,将显示导航对应的内容。这个内容区域需要使用一个容器来表示。
必须设定这个容器的id为android:id/tabcontent
3. Navigation area
需要指定导航元素——TabWidget
1. When the ID is specified, it is Android: ID / tabhost. When binding, it uses android.r.id.tabhost
2. The fragment corresponding to each tab will be filled in the tabcontext
① modify activity_ main.xml
② create main_ tab_ A single layout for the bottom navigation of item.xml
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码