ActionBarSherlock - Как установить отступ каждой иконки панели действий?
Как сделать значки панели действий с помощью 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>
1 ответ
Решение
<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
тема.