
在.h
@interface BGVIEwController : UIVIEwController { IBOutlet UIImageVIEw *image;}@property (nonatomic,retain) IBOutlet UIImageVIEw *image;-(IBAction)img1:(ID)sender;-(IBAction)img2:(ID)sender; 在.m
@synthesize image;-(IBAction)img1:(ID)sender; { UIImage *image = [UIImage imagenamed: @"Main.png"];}-(IBAction)img2:(ID)sender; { UIImage *image = [UIImage imagenamed: @"themes.png"];} 顺便说一句,每个图像都有一个按钮!
该应用程序构建,但当我点击任何一个按钮时,没有发生.
解决方法 更换UIImage *image = [UIImage imagenamed: @"Main.png"];
和
UIImage *image = [UIImage imagenamed: @"themes.png"];
同
image.image = [UIImage imagenamed:@"Main.png"];
和
image.image = [UIImage imagenamed:@"themes.png"];
现在它应该工作正常:)
总结以上是内存溢出为你收集整理的objective-c – 使用按钮更改UIImage视图的图像全部内容,希望文章能够帮你解决objective-c – 使用按钮更改UIImage视图的图像所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)