Bottom display effect of Android tabwidget
The tabhost control uses LinearLayout to wrap tabwidget and FrameLayout by default. The layout file is as follows:
In this way, the tabwidget is displayed at the top. There are three ways to put the tabwidget at the bottom.
Method 1: replace the default LinearLayout in the tabhost with relativelayout, and add Android: layout to the tabwidget_ alignParentBottom="true"
Mode 2:
1. Exchange tabwidget and FrameLayout in LinearLayout. 2. Set FrameLayout property: Android: layout_ weight="1" android:layout_ height="0dp"
Mode 3:
1. Move the tabwidget below the LinearLayout tab
2. Add attribute: Android: Layout in FrameLayout_ gravity="top"
3. Add attribute: Android: Layout in tabwidget_ gravity="bottom"
The above three methods passed the test under Android 4.2.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.