【发布时间】:2018-10-16 12:10:29
【问题描述】:
我尝试在按下按钮后使按钮不可见。 Connection 是一个动作而不是一个出口,因为按下按钮会调用额外的代码。
@IBAction func startGame(_ sender: Any) {
print("The game starts...")
}
这不起作用,因为按钮是一个动作而不是一个出口:
startGame.isHidden = true
是否有其他方法可以使操作按钮不可见,因此不可点击?
【问题讨论】:
-
试试
sender.isHidden = true -
从技术上讲,什么是操作按钮?
-
@PratikPrajapati sender.isHidden = true 不幸的是也不起作用
-
将
_ sender: Any更改为_ sender: UIButtonn 再试一次
标签: swift xcode iboutlet ibaction