Removing bottom shadow on ActionBar - Android -
i want disable actionbar
shadow in 1 activity
. if use code change in whole aplication.
<style name="myapptheme" parent="android:theme.holo.light"> <item name="android:windowcontentoverlay">@null</item> </style>
i tried code, not working
getsupportactionbar().setelevation(0);
any suggestion...?
you can set own style activity this:
<!-- main theme actionbar shadow. --> <style name="myapptheme" parent="android:theme.holo.light"> .... </style> <!-- theme without actionbar shadow (inherits main theme) --> <style name="mynoactionbarshadowtheme" parent="myapptheme"> <item name="windowcontentoverlay">@null</item> <item name="android:windowcontentoverlay">@null</item> </style>
so in manifest.xml can set different style activities:
<!-- activity actionbar shadow --> <activity android:name=".shadowactivity" android:theme="@style/myapptheme"/> <!-- activity without actionbar shadow --> <activity android:name=".noshadowactivity" android:theme="@style/mynoactionbarshadowtheme"/>
or can set right theme programmatically in oncreate() method:
@override protected void oncreate(bundle savedinstancestate) { settheme(r.style.mynoactionbarshadowtheme); super.oncreate(savedinstancestate); //... }
Comments
Post a Comment