加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 布局参数layout_weight被忽略,除非在标记上也指定了layo

发布时间:2020-12-15 02:10:02 所属栏目:Java 来源:网络整理
导读:我将此消息视为错误,无法运行该应用程序. include android:layout_weight="1" layout="@layout/button_row"/include android:layout_weight="1" layout="@layout/button_row"/include android:layout_weight="1" layout="@layout/button_row"/ include layou
我将此消息视为错误,无法运行该应用程序.

<include 
    android:layout_weight="1"
    layout="@layout/button_row"/>
<include 
    android:layout_weight="1"
    layout="@layout/button_row"/>
<include 
    android:layout_weight="1"
    layout="@layout/button_row"/>    
 <include 

    layout="@layout/button_row"
    android:layout_weight="1"/>

android:layout_weight =“1”这行会导致错误.但是,它们使布局文件看起来像需要(在屏幕截图中)

enter image description here

以下是include标记中的内容

<style name="RemoteButton">
    <item name="android:layout_width"> 0dp </item>
    <item name="android:layout_height"> match_parent </item>`

如何让它看起来像我需要没有错误?谢谢

解决方法

将styles.xml更改为此
它将工作相同

<style name="RemoteButton">
    <item name="android:layout_width"> 0dp </item>
    <item name="android:layout_height"> match_parent </item>
    <item name="android:layout_weight">1</item>
<style>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读