Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在快速开发一个个人项目(对于 macOS 应用程序),我想制作一个 NSbutton (触摸栏按钮)并将其隐藏。 有没有可能的方法来做到这一点?
我找到了答案! 写吧:
<button_name>.isHidden = true
或者如果您想禁用而不是隐藏:
<button_name>.isEnabled = false
就我而言,我有一个名为“submitButton”的按钮,所以我写道:
submitButton.isHidden = true
当我希望它出现时,我写道:
submitButton.isHidden = false