2010-07-01 37 views
0

的背景图像I有一个类:更改的UIView

@interface UIExView : UIView { 
....... 
} 

在另一类,UIExView被定义为以下:

IBOutlet UIExView* exView; 

EXVIEW被连接到一个XIB视图。

我设置低照度的背景图像:

UIColor* bgrColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed: backgroundImageName]]; 
exView.backgroundColor = bgrColor; 

现在,我要换另一个图像作为超高感度的背景。我做同样的事情:

UIColor* newBgrColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed: anotherBackgroundImage]]; 
exView.backgroundColor = newBgrColor; 

它很好的模拟运行(背景图像更改为新的一个),但它并不真实设备的工作。请分享您的经验,谢谢。

回答

0

也许您可以尝试在UIExView中添加UIImageView,将IBOutlet制作为UIImageView,然后制作一些允许您更改背景图像的方法?只是一个想法。

+0

感谢您的意见。我只是想知道为什么背景图像不会在真实设备上发生变化。 – user381563 2010-07-02 13:38:50