問題描述
我正在處理 TabWidget,并且在 TabActivity 和 Tabs 之間出現了一個空白.
I am working on the TabWidget and i am getting a white space between the TabActivity and the Tabs.
我不知道如何刪除這個空白請任何人幫助我應該如何刪除它,我的 tab_main.xml 如下:
I don't know how to remove this white space please can any one help me out how should i remove it, my tab_main.xml is as follows :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TabHost
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" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0" />
</LinearLayout>
</TabHost>
我嘗試將 TabWidget 的背景顏色設置為 android:color:transparent 但在 Activity 和 Tab 之間仍然存在相同的空白.
I tried to put background color of TabWidget to android:color:transparent but still same white space comes between the Activity and the Tab.
我不希望我的 Activity 和選項卡之間有任何分隔空間(可以這樣做嗎?)
I do not want any separation space between my Activity and the Tabs (Is it possible to do it?)
請任何人建議我如何擺脫這個空白.
Please can any one suggest me how to get rid of this white space.
推薦答案
看起來您遇到了與我在項目中遇到的類似問題,請查看 this 項目并嘗試實現可繪制的 xml 文件并為您的 TabWidget 提供此項目中給出的特定自定義尺寸.它肯定對你有用.
It Look's Like you are having similar issue as i was having in my project, check out this project and try to implement the drawable xml files and provide your TabWidget with the specific custom dimensions as given in this project. It will surely work for you.
這篇關于Android TabWidget空白問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!