簡體   English   中英

在'android'包中找不到屬性'layout_weightSum'的資源標識符

[英]No resource identifier found for attribute 'layout_weightSum' in package 'android'

我有這個簡單的LinearLayout在圖形布局中顯示得很好,但是當我構建項目時,我得到了這個控制台錯誤(我在這里缺少什么?):

在'android'包中找不到屬性'layout_weightSum'的資源標識符

這是布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weightSum="3"
    android:baselineAligned="false"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/tvSpine"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Spine"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/tvPage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Page"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/tvThick"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Thick"/>
    </LinearLayout>
</LinearLayout>

更改:

android:layout_weightSum="3"

至:

android:weightSum="3"

此參數沒有layout前綴。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM