【问题标题】:TableRow doesn't match the layoutTableRow 与布局不匹配
【发布时间】:2015-10-28 07:24:54
【问题描述】:

我正在尝试创建一个 tableLayout 的行来填充整个布局的宽度,但它仍然与内容匹配。

    <LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/nyc_skyline"

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="6dp">

            <ImageView
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:id="@+id/menu_btn"
                android:src="@drawable/lines7" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="text"
                android:id="@+id/bubble_header"
                android:fontFamily="sans-serif-light" />

            <ImageView
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:id="@+id/imageView2"
                android:src="@drawable/ic_gps_fixed_black_48dp"
                android:focusable="false"
                android:longClickable="false" />
        </TableRow>
    </TableLayout>
</LinearLayout>

我附上了screenshot 。 我是使用 android studio 的初学者。

我该如何解决这个问题? 谢谢!

【问题讨论】:

    标签: android xml button tablelayout tablerow


    【解决方案1】:

    删除这个。

    android:layout_margin="6dp"

    【讨论】:

    • 我删除了它,但什么也没发生
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-15
    • 1970-01-01
    • 2021-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多