造型福尔摩斯操作栏 [英] Styling Sherlock Action Bar

查看:190
本文介绍了造型福尔摩斯操作栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将图像设置为夏洛特操作栏的背景,但即使它的720×112像素,这似乎是图像不拉伸。
白色部分仍是操作栏的一部分,该三角形是在正确的位置,在右侧的按钮组,具有在顶部和底部不同边距

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.

我需要使它成为一个9patch形象?不知道为什么它不能正常工作。

Do I need to make it a 9patch image? Not sure why it doesn't work..

我设置了​​背景<$c$c>getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.topbar));

非常感谢预先的帮助!

推荐答案

你把你的图像或华电国际MDPI?尝试切换左右。最后,使用抽取9补丁和安全自己很多头痛的。

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

这篇关于造型福尔摩斯操作栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆