2016-02-07 29 views
0

我的main.xml我APP_NAME沒有顯示是這樣的:當我勞克模擬器

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:background="@color/background" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:paddingBottom="@dimen/activity_vertical_margin" 
     android:paddingLeft="@dimen/activity_horizontal_margin" 
     android:paddingRight="@dimen/activity_horizontal_margin" 
     android:paddingTop="@dimen/activity_vertical_margin" 
     tools:context="com.example.qiaoyi.tipcalculator.MainActivity"> 

我的清單看起來像這樣:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.qiaoyi.tipcalculator"> 

    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 
     <activity android:name=".MainActivity"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

我嘗試添加機器人:標籤= 「@ string/app_name」之前,我的清單,但它仍然無法正常工作。所以我把它拿出來。我的代碼有什麼問題?謝謝。

+0

你是什麼意思pp_name在啓動模擬器時沒有顯示,你可以詳細說明一下.. @ smart_cookie – Shishram

回答

0

你的strings.xml文件是什麼樣子的?

更新在strings.xml文件的程序名稱:

<resources> 
    <string name="app_name">My super cool tool</string> 
</resources> 
+0

我的string.xml的確如此。 –

0

除了在manifestlabel值,則必須設置定義字符串APP_NAME/RES /價值/串.xml,這樣:

<string name="app_name">Your app name</string> 
相關問題