UIScrollView *scrollView = [[UIScrollView alloc] init];
scrollView.frame = CGRectMake(0, 64, XDScreenW, XDScreenH-64);
scrollView.pagingEnabled = YES;
scrollView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:scrollView];
for (NSUInteger i = 0; i < _array.count; i ++) {
UIImageView *subView = [[UIImageView alloc] initWithFrame:CGRectMake(0,
(scrollView.frame.size.height) * i,
scrollView.frame.size.width,
scrollView.frame.size.height)
];
NSString *urlStr=[NSString stringWithFormat:@"%@/f/F%@.png",WebServiceURL,_array[i]];
NSLog(@"abcd===%@",urlStr);
[subView sd_setImageWithURL:[NSURL URLWithString:urlStr]];
[scrollView addSubview:subView];
}
// 计算 UIScrollView 的总高度
CGFloat height = (scrollView.frame.size.height) * _array.count;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, height);
[self.view addSubview:scrollView];
scrollView.frame = CGRectMake(0, 64, XDScreenW, XDScreenH-64);
scrollView.pagingEnabled = YES;
scrollView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:scrollView];
for (NSUInteger i = 0; i < _array.count; i ++) {
UIImageView *subView = [[UIImageView alloc] initWithFrame:CGRectMake(0,
(scrollView.frame.size.height) * i,
scrollView.frame.size.width,
scrollView.frame.size.height)
];
NSString *urlStr=[NSString stringWithFormat:@"%@/f/F%@.png",WebServiceURL,_array[i]];
NSLog(@"abcd===%@",urlStr);
[subView sd_setImageWithURL:[NSURL URLWithString:urlStr]];
[scrollView addSubview:subView];
}
// 计算 UIScrollView 的总高度
CGFloat height = (scrollView.frame.size.height) * _array.count;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, height);
[self.view addSubview:scrollView];