2017-03-17 5 views
-2
<?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.kun.www.love.MainActivity"> 
    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:src="@drawable/party" 
     android:scaleType="centerCrop"/> 
    <TextView 
     android:text="Happy Birthday, Kun" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textColor="@android:color/white" 
     android:textSize="36sp" 
     android:fontFamily="san-serif-light" 
     android:layout_marginTop="20dp" 
     android:layout_marginLeft="20dp"/> 
    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="@string/Love" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:textColor="@android:color/white" 
     android:textSize="36sp" 
     android:fontFamily="san-serif-light" 
     android:layout_marginBottom="20dp" 
     android:layout_marginRight="20dp"/> 
</RelativeLayout> 


<resources> 
    <string 
     name="Love" 
     >From Kun</string> 
</resources> 

これは解決方法ですが、失敗しました。 私は初心者です、本当にあなたの助けが必要です。 ありがとうございます。ファイル内指定された名前と一致するリソースが見つかりません(値 '@文字列/ app_name'の 'label'にあります)

enter image description here enter image description here

答えて

0

チェックのres /値/のstrings.xmlはAPP_NAMEを持っているかどうか?その

<string name="app_name">"Your App name"</string> 
0

は、アプリケーションタグにマニフェストファイルに追加追加していない場合は、この行の下に

android:label="@string/app_name" 

もがラインの下にstring.xmlをファイルにで保存されて

<string name="app_name">App Name</string> 
+0

ありがとうございます。 – Kun

0

XMLファイルを追加しますres/values/strings.xml

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <string 
     name="Love" 
     >From Kun</string> 
</resources> 

とこれもあります

<string name="app_name">"My App"</string> 
関連する問題