【发布时间】:2010-07-01 21:56:27
【问题描述】:
我有课:
@interface UIExView : UIView {
.......
}
在另一个类中,UIExView 定义如下:
IBOutlet UIExView* exView;
exView 连接到 XIB 中的一个 View。
我将 exView 的背景图片设置为:
UIColor* bgrColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed: backgroundImageName]];
exView.backgroundColor = bgrColor;
现在我想将另一张图片更改为 exView 的背景。我做同样的事情:
UIColor* newBgrColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed: anotherBackgroundImage]];
exView.backgroundColor = newBgrColor;
它在模拟器上运行良好(背景图像更改为新的),但它在真实设备上不起作用。请分享您的经验,谢谢。
【问题讨论】: