Objective c UIScrollView-在图像背景上滑动的透明PNG

Objective c UIScrollView-在图像背景上滑动的透明PNG,objective-c,uiscrollview,Objective C,Uiscrollview,试图使PNG透明度显示在UIScrollView中。而不是透明现在是全黑的。我试图将view.opaque=NO和view.backGroundcolor=[UIColor clearColor]设置为无效 RootViewController的图像背景设置为 self.view.opaque = NO; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"appBackgrou

试图使PNG透明度显示在UIScrollView中。而不是透明现在是全黑的。我试图将view.opaque=NO和view.backGroundcolor=[UIColor clearColor]设置为无效

RootViewController的图像背景设置为

self.view.opaque = NO;    
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"appBackground.png"]];
RootViewController还有一个UIScrollView,我将另外两个UIViewController视图(leftScreen、centralScreen)加载到:

centralScreen.view有一个24位的透明PNG背景,我在它的UIViewController中用

self.view.opaque = NO;    
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"homePageText.png"]];

最后,中央屏幕背景PNG的透明度应为黑色。有关于如何解决此问题的建议/提示吗?谢谢

您不应该使用backgroundColor,因为您无法控制图像的绘制方式(即:无法调整其大小)。
我建议您将UIImageView设置为“背景”(添加它,然后使用sendSubviewToBack:)。

只是好奇,您希望在透明度后面看到什么?你想让中央屏幕滑到左屏幕上吗?看起来他们会一起向左滑动。谢谢你的提示。使用UIImageView显示透明的PNG。由于某些原因,colorWithPatternImage不符合PNG透明度。
self.view.opaque = NO;    
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"homePageText.png"]];