UISwitch像UIButton一样调整ImageWhenDisabled?
我正在创建一个应用程序,允许用户将自己的 UISwitch
和 UISegmentedControl
控件添加到屏幕上。然后他们可以操纵颜色、标题等。尽管为了让我“选择”它们并在我的开发环境中操纵它们,我需要将用户交互/启用设置为“否”。这样做会导致控件“变暗”并变得透明。我真的不希望这样,因为控件的颜色也很暗,因此颜色表示不正确。
UIButton 有一个选项:@property(nonatomic) BOOL adjustmentImageWhenDisabled 我想要这样的 UISwitch
和 UISegmentedControl
有没有办法让它成为禁用的 UISwitch
和 UISegmentedControl 不是“变暗”吗?
谢谢, 斯科特<-
I'm creating an application that allows the user to add their own UISwitch
and UISegmentedControl
controls to the screen. Then they can Manipulate the colors, titles, etc. Though in order for me to 'select' them and manipulate them in my Development environment I need to set the user Interaction/enabled to NO. Doing this causes the Controls to 'dim' and become a but transparent. I don't really want that as the Colors of the controls are also dim so the color representation is not correct.
the UIButton has an option: @property(nonatomic) BOOL adjustsImageWhenDisabled
I'd like something like this for UISwitch
and UISegmentedControl
Is there a way to make it so a disabled UISwitch
and UISegmentedControl
is not 'dimmed' ?
Thanks,
Scott<-
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知没有。
但是,您可以用不同的方式解决这个问题:)
在所有内容上添加一个新的透明 UIView 并使用它来捕获您的触摸事件。这将使您将 UIControls userInteractionEnabled 设置为 YES,但触摸永远不会到达它们:)
Not that I know of.
However, you can solve this in a different way :)
Add a new transparent UIView over everything and use this to grab your touch events. This would let you keep your UIControls userInteractionEnabled set to YES but the touches would never reach them :)