7

I'm attempting to use a different "homeAsUpIndicator" graphic on the action bar, and I'm running into some margin issues with the edge of the screen and the graphic.

Using the "android:homeAsUpIndicator" attribute with a value of @drawable/my_graphic in the styles.xml for the project, I've managed to change the indicator to a custom graphic. That graphic has been designed with a 0dp left margin in mind - as in the left edge of the graphic should go all the way to the left edge of the screen. Instead, I'm getting a 6 pixel margin on both the top and the left side the image.

I've tried setting the margins and padding in my styles.xml, but either that doesn't work or I've applied it to the wrong resource. Also, I tried setting the actionbar background to a 9-patch graphic and let the standard indicator graphic (the "<" in Honeycomb 3.1) float on top of it...that didn't work either, as it just pushed the indicator graphic to the right of the fixed pixels of the background. It only overlayed the pixels that were identified as the stretch pixels in the 9-patch.

Is there a way to remove the 6-pixel padding/margin from the actionbar so the indicator graphic is flush with the left side of the screen? Any examples or leads would be greatly appreciated!

Thank you

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
Kyle
  • 606
  • 5
  • 16

1 Answers1

0

Have you provided drawables for different screen sizes / resolutions / densities? Though they should resize automatically.

See here for icon design of action bar : http://developer.android.com/guide/practices/ui_guidelines/icon_design_action_bar.html

Also you can check the standard icons being used in your sdk folder and adapt yours to those:

the path is:

ANDROID_SDK/platforms/android-XX/data/res/drawable-XXX https://stackoverflow.com/questions/8179653/where-can-i-find-standarts-icons-for-actionbar

Otherwise check also here:

How to remove the margin between the app icon and the edge of the screen on the ActionBar?

Also you could use a custom action bar:

Custom title bar without padding (Android)

Community
  • 1
  • 1
SunnySonic
  • 1,318
  • 11
  • 37