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.
我在 NSToolbarItem 中有一个刷新按钮,并且希望在加载数据时用 NSProgressIndicator 替换刷新图标。这可能吗?值得注意的是,它应该仍然是一个按钮(或至少看起来像一个),但有进度指示器而不是按钮。
我建议您将 progressIndicator 与您的按钮放在同一个位置,但带有隐藏标志。按下按钮后,将其隐藏并显示进度指示器。
为了获得更好的效果,您可以使用[[button animator] setHidden:YES]但不要忘记让您的视图层支持,以使动画师工作。
[[button animator] setHidden:YES]