android - setDisplayHomeAsUpEnabled using a style attribute -
is possible when usingappcompatactivityto specify getsupportactionbar().setdisplayhomeasupenabled(true)using styles, rather doing programmatically?
i can specify drawable itself, how enable using styles?
<style name="myactivitytheme" parent="theme.appcompat.light.darkactionbar"> <item name="actionbartheme">@style/myactionbar</item> </style> <style name="myactionbar" parent="themeoverlay.appcompat.dark.actionbar"> <item name="homeasupindicator">@drawable/ic_clear</item> <!-- enable above using style attribute --> </style>
in styles:
<style name="myactionbarstyle" parent="widget.appcompat.light.actionbar.solid"> <item name="displayoptions">showtitle|homeasup</item> </style> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> ... <item name="actionbarstyle">@style/myactionbarstyle</item> </style> will launch activity arrow:

Comments
Post a Comment