如何启用UISegmentedControl的多个段? [英] How can I enable multiple segments of a UISegmentedControl to be selected?
问题描述
让我们说我的UISegmentedControl有8个编号的段。我希望用户能够一次打开2,3或更多。切换他们。基本上就像一个字节中的位。这可能吗?我相信它是在普通的Mac OS X上,但我似乎无法在iPhone SDK中找到一种方法。
Lets say my UISegmentedControl has 8 numbered segments. I would like for the user to be able to turn on 2, 3, or more of them at once. Toggling them. Essentially like a bits in a byte. Is this possible? I believe it is on regular Mac OS X but I can't seem to find a way to do it in the iPhone SDK.
如果我必须通过放置来模拟这个按钮进入视图,有没有办法做到以下几点:
If I have to simulate this by putting buttons into a view, is there any way to do the following:
- 围绕视图的角落,使其看起来像酒吧 style UISegmentedControl?
- 使用bar样式在按钮上的内置背景?
- 给按钮一个像整个阴影酒吧的风格有哪些? (不是文字)
推荐答案
使用UIKit是不可能的。我建议创建一个自定义控件,或一个 UISwitch
控件的数组,代表UISegmentedControl中的每个选项。
This isn't possible using UIKit. I would recommend creating a custom control, or an array of UISwitch
controls, representing each of the options in your UISegmentedControl.
这篇关于如何启用UISegmentedControl的多个段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!