我是Android開發的新相對論,但我確實喜歡認爲我趕上了。我一直在重新爲我的壘球隊製作一個應用程序。以前我使用過Google的App Inventor,但遇到了很多不足之處,所以現在我試圖用Eclipse重新使用它。與TabHost佈局不需要的邊距
無論如何,要點。我似乎有一些額外的填充被添加到我的LinearLayout,我不確定它來自哪裏。
我正在使用TabHost在頂部創建標籤(Google標籤示例的修改版本)。
佈局XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_linlay_parent"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
>
<!-- Allow the "Tabs" to scroll horizontally -->
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
>
<!-- The "Tabs" widget -->
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000000"
/>
</HorizontalScrollView>
<!-- Provide the "Content" the ability to vertically scroll -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="65dp"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:id="@+id/tabdata"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</LinearLayout>
</FrameLayout>
</ScrollView>
</RelativeLayout>
</TabHost>
</LinearLayout>
我相信這個問題必須與在滾動型的android:layout_marginTop="65dp"
,但如果我刪除它,我的標籤消失(我假設我tabcontent只是被疊加在上面)。最後,這裏是一個屏幕截圖,展示了我正在經歷的一個示例(Disreguard XML字符串,我仍然需要按摩該部分,我只是想用數據展示一個示例。)。 http://kahunaball.com/android/screenshot_0.jpg