android 選項卡(TabHost)如何放置在屏幕的底部
更新時間:2013年01月07日 14:36:29 作者:
如何將TAB放置在屏幕的底端,有很多的新手都想實現(xiàn)這種效果,本文搜集整理了一些,感興趣的朋友可以參考下哦
今天寫Tab的時候由于TAB的跳轉問題去查資料,倒反而發(fā)現(xiàn)更有趣的問題,就是如何將TAB放置在屏幕的底端。
<?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" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:padding="5dp" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</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" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:padding="5dp" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</TabHost>
您可能感興趣的文章:
相關文章
Android實現(xiàn)本地Service方法控制音樂播放
這篇文章主要為大家詳細介紹了Android實現(xiàn)本地Service方法控制音樂播放,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-03-03Android系統(tǒng)聯(lián)系人全特效實現(xiàn)(上)分組導航和擠壓動畫(附源碼)
本文將為大家講解下Android系統(tǒng)聯(lián)系人全特效實現(xiàn)之分組導航和擠壓動畫,具體實現(xiàn)及源代碼如下,感興趣的朋友可以參考下哈,希望對大家學習有所幫助2013-06-06Android使用shape使組件呈現(xiàn)出特殊效果的方法
這篇文章主要介紹了Android使用shape使組件呈現(xiàn)出特殊效果的方法,結合實例形式分析了Android中shape文件相關屬性、功能及使用方法,需要的朋友可以參考下2017-07-07Recyclerview添加頭布局和尾布局、item點擊事件詳解
這篇文章主要為大家詳細介紹了Recyclerview添加頭布局和尾布局、item點擊事件的相關資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-08-08Android TimePicker 直接輸入的問題解決方案
這篇文章主要介紹了Android TimePicker 直接輸入的問題解決方案的相關資料,需要的朋友可以參考下2017-04-04Android Studio中通過CMake使用NDK并編譯自定義庫和添加預編譯庫
這篇文章是基于Android Studio 3.01版本的,NDK是R16。本文重點給大家介紹Android Studio中通過CMake使用NDK并編譯自定義庫和添加預編譯庫的相關知識,感興趣的朋友一起看看吧2018-01-01Android有效獲取狀態(tài)欄(StatusBar)高度的方法
這篇文章主要介紹了Android有效獲取狀態(tài)欄(StatusBar)高度的方法,涉及Android針對狀態(tài)欄(StatusBar)屬性操作的相關技巧,需要的朋友可以參考下2016-08-08Android編程實現(xiàn)類似天氣預報圖文字幕垂直滾動效果的方法
這篇文章主要介紹了Android編程實現(xiàn)類似天氣預報圖文字幕垂直滾動效果的方法,涉及Android基于布局及事件響應實現(xiàn)圖文滾動效果的相關操作技巧,需要的朋友可以參考下2017-08-08