2014-01-10 17 views

Antwort

11

Ich hatte das gleiche Problem, aber ich fand einen Weg, um das Problem zu umgehen. Sie müssen Folgendes festlegen:

getActionBar().setCustomView(R.layout.xyz); 
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP); 

Dann wird die Navigationsleiste + Symbol angezeigt.

Wenn Sie nicht möchten, dass das Symbol sichtbar ist, können Sie ein transparentes Bild (einfach transparentes Bild transparent.png erstellen und in einen ziehbaren Ordner einfügen) anstelle des App-Symbols einfügen.

<style name="Theme.MyAppTheme" parent="android:style/Theme.Holo.Light"> 
    <item name="android:actionBarStyle">@style/Theme.MyAppTheme.ActionBar</item> 
</style> 
<style name="Theme.MyAppTheme.ActionBar" parent="android:style/Widget.Holo.Light.ActionBar"> 
    <item name="android:icon">@drawable/transparent</item> 
</style> 
+0

Das Hinzufügen des transparenten Symbols funktioniert nicht, können Sie mir bitte die Lösung zum Entfernen des App-Symbols aus der Aktionsleiste im obigen Fall mitteilen. – mark

+0

@mark zum Entfernen des App-Symbols actionBar.setIcon (android.R.color.transparent); funktioniert – khurramengr

+0

@didi Navigation Schublade Symbol ist immer noch unsichtbar, irgendwelche Ideen ??? – khurramengr

1

für mich gearbeitet: Sie können durch die Definition neuer Stil für Aktionsleiste (styles.xml) tun

getActionBar().setCustomView(R.layout.xyz); getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME);

1

actionBar.setDisplayOptions (ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);

Verwandte Themen