我在applicationDidFinishLaunching中拍摄了一个图像视图,如下所示。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIImageView* imageBg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 20, 320, 460)];
imageBg.image = [UIImage imageNamed:@"AppBG.png"];
[self.window addSubview:imageBg];
[self.window sendSubviewToBack:imageBg];
}
现在在rootViewController我有一个按钮
我的需要是按下RootViewController中的按钮时,我想将图像从 AppBG.png 更改为 AppBG1.png