2016-09-30 158 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">