【问题标题】:My UIButton does not disable on touch?我的 UIButton 不会在触摸时禁用?
【发布时间】:2013-02-26 05:37:21
【问题描述】:

我在 storyboard 中创建了一个UIButton,将其声明为 .h 中的一个出口,但由于某种原因两者都没有

    addflight.userInteractionEnabled=NO;

    addflight.enabled=NO;

禁用它,我不知道我做错了什么?

【问题讨论】:

    标签: ios uibutton uikit storyboard


    【解决方案1】:

    请检查您是否已将 .h 文件中的 IBOutlet 连接到 nib。 另请查看按钮上方是否没有视图。请参阅启用用户交互。 See The DocSee this tut.

    【讨论】:

    • 按钮上方有一个视图,有问题吗?
    • 是的,它不允许触摸传递到按钮。 Doc
    • 你可以调用`[self.view bringSubviewToFront:myButton];`
    猜你喜欢
    • 1970-01-01
    • 2015-07-26
    • 1970-01-01
    • 1970-01-01
    • 2011-01-04
    • 1970-01-01
    • 1970-01-01
    • 2016-12-14
    • 1970-01-01
    相关资源
    最近更新 更多