Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 带图案图像的UIColor UIScrollView_Objective C_Xcode - Fatal编程技术网

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
,然后将它们逐个添加到滚动条中