当我在基于导航的iPhone应用程序中收到内存警告时,背景图像在先前分配的导航控制器中消失。iPhone应用程序 - 内存警告后背景消失
背景图像被设置为UIView的背景属性。然后,该视图被添加到应用程序委托的主窗口:
UIView *backgroundView = [[UIView alloc] initWithFrame: window.frame];
backgroundView.backgroundColor = [的UIColor colorWithPatternImage:[[用具sharedManager] getImageWithName:@ “Hintergrund2”]]; backgroundView.tag = 56789; [window addSubview:backgroundView]; [backgroundView release];
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
当我收到内存警告信息并按下导航控制器的后退按钮时,以前的导航控制器显示正常的Apple灰色背景。我必须回到我的主屏幕并向前导航以“重置”背景图像。
谁能告诉我为什么背景消失?这不是因为图像,当我将背景设置为像blackColor这样的标准UIColor时,背景(颜色)也消失了。
预先感谢您的帮助!
问候
菲尔
感谢您的意见。我做了以下没有成功: – 2010-09-13 21:42:47
navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[[Utilities sharedManager] getImageWithName:@“Hintergrund2”]]; – 2010-09-13 21:43:29