2012-07-28 53 views
0

我有這樣的代碼,其將設置一個圖像:的UIColor與圖案圖像的UIScrollView

NSArray *imageFilenames = [NSArray arrayWithObjects:@"background iPad retina.png", @"iPad retina send.png", nil]; 

UIColor *bgColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background iPad retina.png"]]; 
scroll1.backgroundColor = bgColor; 

如何可以在圖案設置多個圖像(從NSArray的而定),這樣我看到一個圖像,然後其他的,然後第一個,然後第二個...

回答

0

雖然我不是100%確定,但我認爲你不能通過設置backgroundColor來做到這一點,因爲colorWithPatternImage方法將爲整個視圖設置一個重複圖像。

也許你應該將圖像設置爲不同的UIView,然後將它們逐個添加到滾動條。