如何使操作栏的图标使用ActionBarSherlock 更接近或远离彼此?像android:layout_marginLeft
或android:paddingRight
?
如果我只是在操作栏上添加图标,那么与下面的Soundhound屏幕截图相比,它们会更远:
我的themes.xml
:
<style name="Theme.AstraTheme_Purple" parent="@style/Theme.Sherlock">
<item name="actionBarStyle">@style/Widget.AstraTheme_Purple.ActionBar</item>
<item name="android:actionBarStyle">@style/Widget.AstraTheme_Purple.ActionBar</item>
<item name="actionButtonStyle">@style/Widget.AstraTheme_Purple.ActionButton</item>
<item name="android:actionButtonStyle">@style/Widget.AstraTheme_Purple.ActionButton</item>
</style>
<style name="Widget.AstraTheme_Purple.ActionBar" parent="Widget.Sherlock.ActionBar">
<item name="android:background">@drawable/purple_bar</item>
<item name="background">@drawable/purple_bar</item>
</style>
<style name="Widget.AstraTheme_Purple.ActionButton" parent="Widget.Sherlock.ActionButton">
<item name="android:minWidth">50dip</item>
</style>
答案 0 :(得分:33)
<style name="AppTheme" parent="Theme.Sherlock">
<item name="actionButtonStyle">@style/MyActionButtonStyle</item>
<item name="android:actionButtonStyle">@style/MyActionButtonStyle</item>
</style>
<style name="MyActionButtonStyle" parent="Widget.Sherlock.ActionButton">
<item name="android:minWidth">32dip</item>
<item name="android:padding">0dip</item>
</style>
android:minWidth
按钮的默认值ActionBar
为56dip
。
不要忘记将@style/AppTheme
设置为Activity
的主题。