Styling Sherlock Action Bar

老子叫甜甜 提交于 2019-12-07 10:29:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!