簡體   English   中英

錯誤:在包“ android”中找不到屬性“ layout_toLeftof”的資源標識符

[英]error: No resource identifier found for attribute 'layout_toLeftof' in package 'android'

為什么會出現此錯誤?

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        ...

        <EditText
            android:id="@+id/text_spent1"
            android:layout_width="100dp"
            android:layout_marginTop="20dp"
            android:layout_height="wrap_content"
            android:layout_below="@+id/groc_store"
            android:layout_centerInParent="true"
            android:hint="-"
            android:inputType="number"
            />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftof="@+id/text_spent1"
            android:layout_below="@+id/groc_store"
            android:text="Spent: $"
            />

        ...

    </RelativeLayout>

我也嘗試了android:layout_toRightof但是對於layout_toRightof屬性,我得到了同樣的錯誤消息。 我也嘗試只使用"@id/text_spent1"

更改為

android:layout_toLeftOf="@+id/text_spent1"

大寫字母“ O”

RelativeLayout.LayoutParams文檔

暫無
暫無

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

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