UIScrollView * scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT * 0.35)];
[self addSubview:scrollView];
self.scrollView = scrollView;
for (int i = 0; i < 6; i++) {
UIImageView * imageViwe = [[UIImageView alloc] initWithFrame:CGRectMake(scrollView.width * i, 0, WIDTH, scrollView.height)];
NSString * name = [NSString stringWithFormat:@"00%d",i+1];
imageViwe.image = [UIImage imageNamed:name];
[scrollView addSubview:imageViwe];
}
scrollView.contentSize = CGSizeMake(WIDTH * 6, 0);
scrollView.pagingEnabled = YES;
scrollView.bounces = NO;
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.delegate = self;
//透明栏
UIView * backView = [[UIView alloc] initWithFrame:CGRectMake(0, scrollView.height - 30, WIDTH, 30)];
backView.backgroundColor = MZMCOLOR(0, 0, 0, 0.2);
[self addSubview:backView];
UILabel * nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, WIDTH - 100, 20)];
nameLabel.text = @"balabla";
nameLabel.font = [UIFont systemFontOfSize:15];
nameLabel.textColor = [UIColor whiteColor];
nameLabel.textAlignment = NSTextAlignmentLeft;
[backView addSubview:nameLabel];
//分页控制
UIPageControl * pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(WIDTH - 80, 5, WIDTH, 20)];
pageControl.numberOfPages = 6;
pageControl.pageIndicatorTintColor = [UIColor whiteColor];
pageControl.currentPageIndicatorTintColor = MZMColor;
pageControl.backgroundColor = [UIColor redColor];
pageControl.currentPage = 0;
[backView addSubview:pageControl];
self.pageControl = pageControl;
代码如上所示 但是显示出来的UIPageControl只有一个点求大大们帮忙看看![图片说明](https://img-ask.csdn.net/upload/201601/12/1452568080_743907.png)