Using a Button to change an Image in a UIimageView in a separate ViewController

巧了我就是萌 提交于 2020-01-06 08:38:10

问题


I have several different buttons, which are all segued modally to another ViewController that contains several UIimage views. What I'm trying to do is to create an IBAction for each button that will set images to the UIimageViews in the other ViewController. (my UIimageViews are @property(nonatomic, retina) and I have tried multiple codes like "setImage" and many others with no success) I wass wondering if this could be done by using tags?

THANKS!!!


回答1:


Use Delegates delegate. On button click invoke the selector on the delegate. In the selector set the image.



来源:https://stackoverflow.com/questions/23937599/using-a-button-to-change-an-image-in-a-uiimageview-in-a-separate-viewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!