2016-08-21 75 views
0

發現屬性「Layout_below」沒有資源標識符我非常非常新的這個 - 剛剛做初學者的啓動Android應用開發 - 所以我爲這個愚蠢的問題:(在包「機器人」

對不起我試圖運行我的應用我的電話,得到了以下錯誤:

C:\Users\melod\AndroidStudioProjects\CardForMelody\app\src\main\re\layout\activity_main.xml 
Error:(36) No resource identifier found for attribute 'Layout_below' in package 'android' 
Error:Execution failed for task ':app:processDebugResources'. 
> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException: Process 'command 'C:\Users\melod\AppData\Local\Android\Sdk\build-tools\24.0.1\aapt.exe'' finished with non-zero exit value 1 
Information:BUILD FAILED 

誰能幫助我的代碼如下所示:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.android.cardformelody.MainActivity"> 


<ImageView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:src="@drawable/rosetrim" 
    android:scaleType="centerCrop"/> 

<TextView 
    android:id="@+id/Melody" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textSize="34sp" 
    android:fontFamily="Thin" 
    android:layout_marginLeft="110dp" 
    android:layout_marginBottom="10dp" 
    android:layout_marginTop="200dp" 
    android:text="Melody..." /> 

<TextView 
    android:id="@+id/thebest" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textSize="20sp" 
    android:fontFamily="cursive" 
    android:layout_below="@id/Melody" 
    android:layout_marginLeft="170dp" 
    android:text="You're the best" 
    /> 
<TextView 
    android:id="@+id/lovemelody" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textSize="10sp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="120dp" 
    android:layout_marginRight="100dp" 
    android:Layout_below="[email protected]/thebest" 
    android:text="LOVE MELODY" /> 

+0

看起來你有幾個錯別字:'android:Layout_below =「id @/thebest」'應該是'android:layout_below =「@ + id/thebest」' - 在layout_below中帶有小寫'l' '和'@ + id'而不是'id @' – Entea

回答

1

在你最後的TextView

<TextView 
    android:id="@+id/lovemelody" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textSize="10sp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="120dp" 
    android:layout_marginRight="100dp" 
    android:Layout_below="[email protected]/thebest" 
    android:text="LOVE MELODY" /> 

改變這一行

android:Layout_below="[email protected]/thebest" 

這個

android:layout_below="[email protected]/thebest" 

你寫Layout_below,但它是如此layout_below改變它。