Amira Elsayed Ismail
Amira Elsayed Ismail

Reputation: 9394

Action bar Icon not fit like other android icons

I'm Making andriod application, every thing is going well, but when I use a large images for action bar , android platform does not fit the size of action bar, the Icon appear very large , so how can set width and heights of icons in action bar in android

Upvotes: 4

Views: 4793

Answers (3)

Amira Elsayed Ismail
Amira Elsayed Ismail

Reputation: 9394

I have solved this problem by making dim files for each density according to android standard, and when receive the images from the server re-size them with the corresponding dim value and then add them to my action bar

Upvotes: 2

Siddharth Lele
Siddharth Lele

Reputation: 27748

I am not sure why you would want to use large images in an Action Bar

The prescribed sizes for Action Bar icons (API Level 11 and above) are these:

ldpi(120dpi) - 18x18 px

mdpi(160dpi) - 24x24 px

hdpi(240dpi) - 36x36 px

xhdpi(320dpi) - 48x48 px

Visit this link for more info: http://developer.android.com/guide/practices/ui_guidelines/icon_design_action_bar.html

Alternatively, simply use the Android Asset Studio to create the necessary resources for you. All you have to do there is select the Image you want the Action Bar icons for and it creates them for you in a ZIP file ready to use. This one is quite the time saver.

Upvotes: 1

Paresh Mayani
Paresh Mayani

Reputation: 128428

I hope you have read Action Bar Icons document, because document already contains sizes of icons.

enter image description here

Anyway, here is the Android Asset Studio tool which would help you to generate Action bar icons.

Upvotes: 6

Related Questions