嘗試獲取PNG透明度以顯示在UIScrollView中。現在全黑了,而不是透明的。我試圖設置view.opaque = NO,並view.backGroundcolor = [UIColor clearColor]無濟於事。UIScrollView - 在圖像背景上滑動的透明PNG
RootViewController的具有圖像的背景與
self.view.opaque = NO;
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"appBackground.png"]];
RootViewController的設置也我加載兩個其他的UIViewController視圖(leftScreen,centralScreen)轉換成一個UIScrollView:
CGRect frame = scrollView.frame;
frame.origin.x = 0;
frame.origin.y = 0;
leftScreen.view.frame = frame;
[scrollView addSubview:leftScreen.view];
frame.origin.x = frame.size.width;
frame.origin.y = 0;
centralScreen.view.frame = frame;
[scrollView addSubview:centralScreen.view];
的centralScreen.view具有我在其UIViewController中設置的24位透明PNG背景與
self.view.opaque = NO;
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"homePageText.png"]];
最後centralScreen背景PNG在透明度應該是黑色的地方。有關如何解決此問題的任何建議/提示?謝謝!
只是好奇,你期望透明度後面看到什麼?您是否想讓中央屏幕滑過左側屏幕?看起來他們會一起向左滑動。 – morningstar