在包'android'中找不到属性'layout_columnWeight'的资源标识符

问题描述 投票:1回答:3

错误:(25)在程序包'android'中找不到属性'layout_columnWeight'的资源标识符。

我无法在xml中更新它。当我使用网格布局时出现了它。

 <GridLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_centerVertical="true"
    android:layout_toRightOf="@+id/textView"
    android:layout_toEndOf="@+id/textView">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Button"
        android:id="@+id/button"
        android:layout_columnWeight="0"
        />
   </GridLayout>

错误:(25)在包'android'中找不到属性'layout_columnWeight'的资源标识符...。我无法在xml中更新它。.当我使用网格布局时出现了它.. <...>

android resources package
3个回答
8
投票

如果要通过GridLayout属性使用columnWeight,最好的方法是使用v7支持版本。


2
投票
在API 21之前,GridLayout不支持

weight。如果希望它受支持,则可能要使用支持库v7中的GridLayout。或切换到GridView。


0
投票

尽管使用android:layout_columnWeight =“ 1”

© www.soinside.com 2019 - 2024. All rights reserved.