Tech tip of this week

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