2016-09-30 157 views
0

嘗試刪除我的應用程序名稱,但無法執行此操作。如何刪除android studio中的應用程序名稱

這是我的XML主要佈局:

<android.support.design.widget.AppBarLayout 
    android:background="#FF000000" 
    android:id="@+id/appbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:paddingTop="@dimen/appbar_padding_top" 
    android:theme="@style/AppTheme.AppBarOverlay"> 


    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layout_scrollFlags="scroll|enterAlways" 
     app:popupTheme="@style/AppTheme.PopupOverlay"> 


    </android.support.v7.widget.Toolbar> 

    <android.support.design.widget.TabLayout 
     android:background="@color/black" 
     android:id="@+id/tabs" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

</android.support.design.widget.AppBarLayout> 

<android.support.v4.view.ViewPager 
    android:id="@+id/pager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

這是我的字符串資源:

<resources> 
    <string name="action_settings">Settings</string> 
    <string name="section_format">Hello World from section: %1$d</string> 
</resources> 

和清單:

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

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.INTERNET"/> 

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

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

</manifest> 

所以我盡一切辦法刪除應用程序的名稱,但最後總是顯示項目名稱。像這樣:

enter image description here

唐,不想在這裏表現出任何的文字!我能怎麼做 ?如何消除這個!?

回答

0

在你string.xml,加入這一行

<string name="app_name">your_project_name</string> // write nothing if you don't want to show anything 

在你表現

<application 
     android:allowBackup="true" 
     android:label="@string/app_name" // add this line 
     android:icon="@mipmap/ic_launcher" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 

或者,

<application 
      android:allowBackup="true" 
      android:label="" // add this line 
      android:icon="@mipmap/ic_launcher" 
      android:supportsRtl="true" 
      android:theme="@style/AppTheme">