android – TableLayout with layout_width = matchparent不匹配parent

android – TableLayout with layout_width = matchparent不匹配parent,第1张

概述我有一个tableLayout有两列和两行,两行和最后一列都有match_parent的宽度,但布局没有填充父宽度,它像自己的wrap_content一样自我组合. 这是代码: <TableLayout android:layout_width="match_parent"> <TableRow android:layout_width="match_parent"> <T 我有一个tableLayout有两列和两行,两行和最后一列都有match_parent的宽度,但布局没有填充父宽度,它像自己的wrap_content一样自我组合.

这是代码:

<tableLayout androID:layout_wIDth="match_parent">    <tableRow androID:layout_wIDth="match_parent">        <TextVIEw             androID:layout_wIDth="wrap_content"            androID:text="static" />        <EditText            androID:layout_wIDth="match_parent"            androID:text="text" />    </tableRow>    <tableRow androID:layout_wIDth="match_parent">        <TextVIEw             androID:layout_wIDth="wrap_content"            androID:text="static2" />        <EditText            androID:layout_wIDth="match_parent"            androID:text="text2" />    </tableRow></tableLayout>

对于具有父级宽度的每一行,我需要做什么?

Ps:我工作的地方不允许我发布我的代码,所以我编写了尽可能接近我的代码的代码.我不知道它是不对的,我无法测试.

@H_404_10@解决方法 试试这个代码,我想这会帮助你
<tableLayout    xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="fill_parent"     androID:layout_height="wrap_content"    >    <tableRow androID:layout_wIDth="match_parent" >        <TextVIEw            androID:layout_wIDth="fill_parent"            androID:layout_weight="1"            androID:text="static" />        <EditText            androID:layout_wIDth="match_parent"            androID:layout_weight="1"            androID:text="text" />    </tableRow>    <tableRow androID:layout_wIDth="match_parent" >        <TextVIEw            androID:layout_wIDth="fill_parent"            androID:layout_weight="1"            androID:text="static2" />        <EditText            androID:layout_wIDth="match_parent"            androID:layout_weight="1"            androID:text="text2" />    </tableRow></tableLayout>
@H_404_10@ @H_404_10@ 总结

以上是内存溢出为你收集整理的android – TableLayout with layout_width = matchparent不匹配parent全部内容,希望文章能够帮你解决android – TableLayout with layout_width = matchparent不匹配parent所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1138383.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存