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.
我在 uitoolbar 上有 4 个按钮,并且我有所有四个按钮的图像,仅用于默认状态。在选择时,我需要将其显示为已选择。现在我的问题是,当没有选定状态的图像时,如何将按钮显示为选定状态。我想显示下图中提到的按钮。怎么做。
您应该寻找标志:“forState”。我会看起来像这样:
forState:UIControlStateNormal
当您的选项卡被选中时,您应该将状态更改为“UIControlStateSelected”。