//初始化scrollview
_vcScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0 ,0, CYXwidth,CYXheight - 64 - 50)];
_vcScrollView.backgroundColor = [UIColor whiteColor];
_vcScrollView.pagingEnabled = YES;
_vcScrollView.bounces = YES;
_vcScrollView.showsHorizontalScrollIndicator = NO;
_vcScrollView.delegate = self;
[self.view addSubview:_vcScrollView];
_vcScrollView.contentSize = CGSizeMake(CYXwidth*5, 0);
ZMLatestViewController *firstV = [[ZMLatestViewController alloc]init];
[self addChildViewController:firstV];
//添加子控制器
ZMNewVersionViewController *twoV = [[ZMNewVersionViewController alloc]init];
[self addChildViewController:twoV];
ZMHeroCircleViewController *threeV = [[ZMHeroCircleViewController alloc]init];
[self addChildViewController:threeV];
ZMVideoViewController *fourV = [[ZMVideoViewController alloc]init];
[self addChildViewController:fourV];
ZMColumnViewController *fifthV = [[ZMColumnViewController alloc]init];
[self addChildViewController:fifthV];
[self scrollViewDidScroll:self.vcScrollView];
网友评论