如何设置 UISegmentedControl 的背景图像
我有一个带有分段控件的视图,我想设置该控件的背景图像。我知道我可以更改设置色调颜色,但我想要对其进行更多控制。所以如果我能设置一个背景图片那就太酷了。
我找到了有关如何实现此目的的教程,但是它已经过时了,我无法让它发挥作用。
有人可以帮我吗?我非常感谢任何帮助。
UPDATE
解决方案已找到一半,如果唯一需要支持的是 iOS5,您可以使用 setBackgroundImage:forState:barMetrics:。 可以在此处找到有关此问题的精彩教程。
I have a view with a segmentedcontrol in it and I would like to set the background image of that control. I know that I can change set the tint color, but I want more control over it than that. So if I could set a background image that would be cool.
I found this tutorial on how to achieve this, however it's outdated, and I'm unable to get it working.
Could anyone please help me? I greatly appreciate any help.
UPDATE
Half the solution has been found, if the only thing one needs to support is iOS5 you can use setBackgroundImage:forState:barMetrics:. A great tutorial on the matter can be found here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个怎么样?: setBackgroundImage:forState:barMetrics:
直接来自文档
注意:适用于 iOS 5.0 及更高版本。
How about this?: setBackgroundImage:forState:barMetrics:
Straight from the docs
Note: Available in iOS 5.0 and later.