简体   繁体   中英

Styling Sherlock Action Bar

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!

在此输入图像描述

Did you put your image in hdpi or mdpi? Try switching around. Ultimately, use draw-9-patch and safe yourself a lot of headache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM