Reputation: 6488
Our app uses Action Bar Sherlock, and it has a theme like such:
<style name="Theme.MyApp.Default" parent="@style/Theme.Sherlock.Light">
<item name="actionButtonStyle">@style/MyApp.SherlockActionBar.Light.ActionButton</item>
<item name="android:actionButtonStyle">@style/MyApp.SherlockActionBar.Light.ActionButton</item>
</style>
<style name="MyApp.SherlockActionBar.Light.ActionButton" parent="@style/Widget.Sherlock.Light.ActionButton">
<item name="android:maxHeight">20dp</item>
<item name="android:maxWidth">20dp</item>
</style>
Where Theme.MyApp.Default
is the default theme for the app.
I need to set the icons for the action buttons (#2 on this image) to be a specific size. When I set the height/width/scaleX/scaleY/scaleType/padding
properties however, the icon on the button still maintain what looks like their pixel size. The text part of the action button does seems to adhere to the setting though. Could it just be a compound drawable on a textview?
How can I set the size of the icon on the action bar?
Upvotes: 0
Views: 6547
Reputation: 1693
Action bar icons for phones should be 32x32 dp.
Action bar icons are graphic buttons that represent the most important actions people can take within your app. Each one should employ a simple metaphor representing a single concept that most people can grasp at a glance.
you refer that link here
Upvotes: 1
Reputation: 6488
More and more evidence points to the fact that the menu on the action bar is a compound drawable. (Setting the property android:drawablePadding
moves the icon from the text.) And seeing that you can't scale the image in XML for a compound drawable, this doesn't seem possible at the moment.
Upvotes: 0
Reputation: 3322
Have you cleaned your project and then run? and you can specify action item height in main.xml(actionbar menu layout ) also though contrl space wont wrk its like normal height prperty. whenever changing styles you have to clean and run the project
Upvotes: 0