首页 > 关于tablerow,它的高度设置了定值,仍然是wrap content的效果呢??

关于tablerow,它的高度设置了定值,仍然是wrap content的效果呢??

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:background="#ffeb3b">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_span="1"
                android:textSize="22sp"
                android:hint="haha"/>
        </TableRow>

The children of a TableRow do not need to specify the layout_width and layout_height attributes in the XML file. TableRow always enforces those values to be respectively MATCH_PARENT and WRAP_CONTENT.

意思就是如果子对象是TableRow 那么他的高度永远是wrap_content.所以你设置也没有用。

【热门文章】
【热门文章】