Objective c 带图案图像的UIColor UIScrollView
我有一个设置一个图像的代码:Objective c 带图案图像的UIColor UIScrollView,objective-c,xcode,Objective C,Xcode,我有一个设置一个图像的代码: NSArray *imageFilenames = [NSArray arrayWithObjects:@"background iPad retina.png", @"iPad retina send.png", nil]; UIColor *bgColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background iPad retina.png"]]; scroll1.backgroun
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),以便看到一个图像,然后是另一个,然后是第一个,然后是第二个……虽然我不是100%确定,但我认为您不能通过设置背景色来做到这一点,因为
colorWithPatternImage
方法将为整个视图设置重复图像
也许您应该将图像设置为不同的UIView
,然后将它们逐个添加到滚动条中