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

查看:173
本文介绍了android - 关于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.所以你设置也没有用。

这篇关于android - 关于tablerow,它的高度设置了定值,仍然是wrap content的效果呢??的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆