0

在我的应用程序中,我有一个选项卡主机和选项卡等问题。我的问题是,我想要高度较低的选项卡。你不知道我的意思吗?这里: http ://www.pic-upload.de/view-17360783/Tabs.png.html

我的标签是 30dp 高,至少这是我写入 height 属性的内容,但是正如您所看到的,这些标签不会缩小到那个大小。我该怎么办,“真实”选项卡上方的这个蓝色区域会消失?

ps:没有任何元素,直到带有“0.25”和“Erhardt Schulze”的列表,选项卡将具有正常高度。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clipChildren="false"
    android:isScrollContainer="true"
    android:minWidth="25px"
    android:minHeight="25px">
    <TabHost
        android:layout_width="fill_parent"
        android:id="@android:id/tabhost"
        android:layout_weight="12"
        android:layout_height="wrap_content"
        android:clipChildren="false">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:id="@+id/linearLayout1"
            android:clipChildren="false">
            <LinearLayout
                android:orientation="vertical"
                android:minWidth="25px"
                android:minHeight="25px"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/linearLayout5"
                android:gravity="top"
                android:layout_weight="1"
                android:clipChildren="false"
                android:isScrollContainer="true">
                <LinearLayout
                    android:orientation="vertical"
                    android:minWidth="25px"
                    android:minHeight="25px"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/linearLayout3">
                    <TableLayout
                        android:minWidth="25px"
                        android:minHeight="25px"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:id="@+id/tableLayout1">
                        <TableRow
                            android:id="@+id/tableRow1">
                            <TextView
                                android:text="@string/UTlbEqID"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbEqID"
                                android:layout_column="0"
                                android:layout_weight="1" />
                            <TextView
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbEqIDVar"
                                android:hint="wie sieht dass denn aus?"
                                android:layout_column="1"
                                android:gravity="right"
                                android:layout_weight="1" />
                        </TableRow>
                        <TableRow
                            android:id="@+id/tableRow2">
                            <TextView
                                android:text="@string/UTlbEqDesc"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbEqDesc"
                                android:layout_column="0"
                                android:layout_weight="1" />
                            <TextView
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbEqDescVar"
                                android:hint="wie sieht dass denn aus?"
                                android:layout_column="1"
                                android:layout_weight="1"
                                android:gravity="right" />
                        </TableRow>
                        <TableRow
                            android:id="@+id/tableRow3">
                            <TextView
                                android:text="@string/UTlbTaskID"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbTaskID"
                                android:layout_column="0"
                                android:layout_weight="1" />
                            <TextView
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbTaskIDVar"
                                android:hint="wie sieht dass denn aus?"
                                android:layout_column="1"
                                android:layout_weight="1"
                                android:gravity="right" />
                        </TableRow>
                        <TableRow
                            android:id="@+id/tableRow5">
                            <TextView
                                android:text="@string/UTlbTaskDesc"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbTaskDesc"
                                android:layout_column="0"
                                android:layout_weight="1" />
                            <TextView
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbTaskDescVar"
                                android:hint="wie sieht dass denn aus?"
                                android:layout_column="1"
                                android:layout_weight="1"
                                android:gravity="right" />
                        </TableRow>
                        <TableRow
                            android:id="@+id/tableRow4">
                            <TextView
                                android:text="@string/UTlbTaskDate"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbTaskDate"
                                android:layout_column="0"
                                android:layout_weight="1" />
                            <TextView
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:id="@+id/lbTaskDateVar"
                                android:hint="wie sieht dass denn aus?"
                                android:layout_column="1"
                                android:layout_weight="1"
                                android:gravity="right" />
                        </TableRow>
                    </TableLayout>
                </LinearLayout>
                <FrameLayout
                    android:id="@android:id/tabcontent"
                    android:layout_width="match_parent"
                    android:layout_height="fill_parent"
                    android:minWidth="25px"
                    android:minHeight="25px"
                    android:clipChildren="false" />
            </LinearLayout>
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="bottom"
                android:tabStripEnabled="false" />
        </LinearLayout>
    </TabHost>
</LinearLayout>
4

1 回答 1

0

我认为您的部分问题可能是由于一些 xml 嵌套。我不确定您包含的表格是否应该在您的标签主机上方或下方,但这是上面表格的示例。

<?xml version="1.0" encoding="utf-8"?>
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clipChildren="false"
    android:isScrollContainer="true"
    android:minWidth="25px"
    android:minHeight="25px">
    <LinearLayout
        android:orientation="vertical"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/linearLayout5"
        android:gravity="top"
        android:layout_weight="1"
        android:clipChildren="false"
        android:isScrollContainer="true">
        <LinearLayout
            android:orientation="vertical"
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:id="@+id/linearLayout3">
            <TableLayout
                android:minWidth="25px"
                android:minHeight="25px"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/tableLayout1">
                <TableRow
                    android:id="@+id/tableRow1">
                    <TextView
                        android:text="@string/UTlbEqID"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbEqID"
                        android:layout_column="0"
                        android:layout_weight="1" />
                    <TextView
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbEqIDVar"
                        android:hint="wie sieht dass denn aus?"
                        android:layout_column="1"
                        android:gravity="right"
                        android:layout_weight="1" />
                </TableRow>
                <TableRow
                    android:id="@+id/tableRow2">
                    <TextView
                        android:text="@string/UTlbEqDesc"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbEqDesc"
                        android:layout_column="0"
                        android:layout_weight="1" />
                    <TextView
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbEqDescVar"
                        android:hint="wie sieht dass denn aus?"
                        android:layout_column="1"
                        android:layout_weight="1"
                        android:gravity="right" />
                </TableRow>
                <TableRow
                    android:id="@+id/tableRow3">
                    <TextView
                        android:text="@string/UTlbTaskID"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbTaskID"
                        android:layout_column="0"
                        android:layout_weight="1" />
                    <TextView
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbTaskIDVar"
                        android:hint="wie sieht dass denn aus?"
                        android:layout_column="1"
                        android:layout_weight="1"
                        android:gravity="right" />
                </TableRow>
                <TableRow
                    android:id="@+id/tableRow5">
                    <TextView
                        android:text="@string/UTlbTaskDesc"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbTaskDesc"
                        android:layout_column="0"
                        android:layout_weight="1" />
                    <TextView
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbTaskDescVar"
                        android:hint="wie sieht dass denn aus?"
                        android:layout_column="1"
                        android:layout_weight="1"
                        android:gravity="right" />
                </TableRow>
                <TableRow
                    android:id="@+id/tableRow4">
                    <TextView
                        android:text="@string/UTlbTaskDate"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbTaskDate"
                        android:layout_column="0"
                        android:layout_weight="1" />
                    <TextView
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:id="@+id/lbTaskDateVar"
                        android:hint="wie sieht dass denn aus?"
                        android:layout_column="1"
                        android:layout_weight="1"
                        android:gravity="right" />
                </TableRow>
            </TableLayout>
        </LinearLayout>
    </LinearLayout>
    <TabHost
        android:layout_width="fill_parent"
        android:id="@android:id/tabhost"
        android:layout_weight="12"
        android:layout_height="wrap_content"
        android:clipChildren="false">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:id="@+id/linearLayout1"
            android:clipChildren="false">
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="bottom"
                android:tabStripEnabled="false" />
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="match_parent"
                android:layout_height="fill_parent"
                android:minWidth="25px"
                android:minHeight="25px"
                android:clipChildren="false" />
        </LinearLayout>
    </TabHost>
</LinearLayout>
于 2012-12-19T14:53:19.230 回答