问题
I'm trying to set an image as background of the Sherlock Action Bar, but even if the it's 720 x 112 px, it seems like the image doesn't stretch. The white part is still part of the Action Bar, as the triangle is set in the correct position and the button on the right, has different margins on the top and at the bottom.
Do I need to make it a 9patch image? Not sure why it doesn't work..
I'm setting the background with a getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.topbar));
Thanks a lot in advance for the help!
回答1:
Did you put your image in hdpi or mdpi? Try switching around. Ultimately, use draw-9-patch and safe yourself a lot of headache.
来源:https://stackoverflow.com/questions/11184999/styling-sherlock-action-bar