简体   繁体   English

如何重置界面生成器中提到的UIButton背景图像?

[英]how to reset UIButton background image mentioned in interface builder?

I creating an iPhone application, set background image for UIButton using interface builder, then i changed the background image for that UIButton programmatically. 我创建了一个iPhone应用程序,使用界面生成器为UIButton设置了背景图片,然后以编程方式更改了该UIButton的背景图片。 Now i need to restore the background programmatically which i have used already(used in interface builder). 现在,我需要以编程方式恢复我已经使用过的背景(在界面生成器中使用)。

After you change the background image programmatically, you either need to call -viewDidLoad (probably after calling -viewDidUnload ) to reset the background, or change it again progammatically. 以编程方式更改背景图像后,您需要调用-viewDidLoad (可能在调用-viewDidUnload )以重置背景,或者以编程方式再次更改背景。 The UIImage doesn't remember it's previous background, so there is no easier way to "restore" the setting. UIImage不会记住它的先前背景,因此没有更简单的方法来“恢复”设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM