0
我正在制作一个简单的应用程序,它将鼠标悬停在按钮上时向用户显示一些信息。我已经找遍了所有的答案,但似乎没有人想过这件事。我知道有可能检测到按钮亮点,因为我在我的Apple TV上下载的某些应用程序中看到了它。这基本上就是我的目标:如何在Swift中检测Apple TV上的按钮高亮
@IBAction func firstButton(_ sender: Any) {
//This function would be called when the first button is highlighted/hovered over
label.text = "Hi there"
}
@IBAction func secondButton(_ sender: Any) {
//This function would be called when the second button is highlighted/hovered over
label.text = "How are you?"
}
我知道,只是创建一个IBAction func
不会做的伎俩,但我只是用这个作为什么我想要做的一个例子。
那么有没有办法检测按钮突出显示/按钮悬停和如何?
在此先感谢。任何帮助表示赞赏。