为什么应用程序名称由它自己显示在应用程序栏中?以及如何删除它?

问题描述:

我在一个活动中创建了一个空白的应用栏,插入了一段文字,一切正常,我修改了一小段代码,现在应用程序名称显示在应用栏中,如何删除它以及它从哪里来的? here is the design and the output为什么应用程序名称由它自己显示在应用程序栏中?以及如何删除它?

和这里的代码

<android.support.v7.widget.Toolbar 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="?attr/colorPrimary" 
    android:theme="?attr/actionBarTheme" 
    android:minHeight="?attr/actionBarSize" 
    android:id="@+id/toolbar" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentStart="true" 
    /> 
+1

参考https://*.com/a/31096517/3981656 –

从操作栏中删除标题试试这个

Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar); 
setSupportActionBar(toolbar); 
getSupportActionBar().setTitle(""); 

尝试这种改变动作条标题

Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar); 
setSupportActionBar(toolbar); 
getSupportActionBar().setTitle("your title");// set your title name 
+0

工作不错,清晰(非常感谢),可我知道什么是错误? –

+0

我明白了,你的回答非常有帮助,但我没有接受答案所需的声望,对不起。 –

+0

@All_Rounder @All_Rounder无需信誉只需将我的答案标记为正确 –

你的活动添加标签清单中

<activity 
     android:name=".ui.SplashActivity" 
     android:label="@string/name_you_want" 
     android:clearTaskOnLaunch="true" 
     android:excludeFromRecents="true" 
     android:screenOrientation="sensor" 
     android:theme="@style/Apollo.Landing"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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