【发布时间】:2016-09-02 10:52:30
【问题描述】:
我有两个视图控制器,aController 和 bController。我在aController 中有一个按钮。现在我想从bController 更改按钮图像。我在aController 中创建了一个名为chageButtonImg 的方法,并在更改UIButton 图像的一些功能后从bController 调用了chageButtonImg 方法。我调用了它,但按钮图像没有更新。
如何更改按钮图像?
【问题讨论】:
-
如果 bController 已经加载,那么您可以使用 NSNotificationCenter 调用特定方法,您可以更改按钮的背景图像。如果它将被 aController 调用,则根据布尔值传递一个布尔变量,您可以设置图像
标签: ios uiviewcontroller uibutton