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:

enter image description here


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -