2016-04-07 11 views
0

Ich benutze Navigation Schublade Aktivität in meiner App, und ich füge nettes Logo auf der Titelleiste. Ich möchte App-Name auf Tittle entfernen. Ich probiere viel Code aus. Ich will nichtEntfernen Sie App-Label auf Navigation Schublade Aktivität (Haupt) und andere alle Aktivität

Theme.AppCompat.NoActionBar 
+0

Sie Symbolleiste Haben? –

+0

sind Sie meine benutzerdefinierte Symbolleiste? –

+0

gibt es nichts wie 'getActionBar(). SetTitle (" ")'? – MKJParekh

Antwort

0

in style.xml

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar"> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
    <item name="android:windowEnableSplitTouch">false</item> 
    <item name="android:splitMotionEvents">false</item> 
</style> 

in androidmainfest

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme.NoActionBar"> 

Versuchen Sie es benutzen!

3

Versuchen Sie folgende Zeile, es kann Arbeit sein.

getActionBar().setDisplayShowTitleEnabled(false); 

oder

getSupportActionBar().setDisplayShowTitleEnabled(false); 
+0

Vielen, vielen Dank. Die getSupportActionBar(). SetDisplayShowTitleEnabled (false); gearbeitet – Ivan

0

In AndroidManifest.xml

<activity 
     android:name=".MainActivity" 
     android:label="" 
     android:theme="@style/AppTheme.NoActionBar" 
     android:configChanges="screenSize|orientation"> 
    </activity> 

in styles.xml unten Code hinzufügen

<style name="AppTheme.NoActionBar"> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
</style> 
+0

Vielen Dank ... –

Verwandte Themen