Current Android Release version:
Version Code: Pie
Version: 9
API level: 28

Android: How to Remove App icon from Action Bar

we can remove the app icon from android in 2 ways.We can declare either in styles or in code.


styles.xml

<!-- Application theme. -->
<style name="AppTheme" parent="android:Theme.DeviceDefault.Light">
        <item name="android:actionBarStyle">@style/MyApp.ActionBar</item>
</style>

<style name="App.ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid">
        <item name="android:displayOptions">showTitle</item>
</style>



onCreate() method in activity or fragment:
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE);

No comments:

Post a Comment