// // WelcomeVC.m // LNManager // // Created by EchoShacolee on 2018/1/12. // Copyright © 2018年 lee. All rights reserved. // #import "WelcomeVC.h" #import "LoginVC.h" @interface WelcomeVC () { UIPageControl *pageControl; } @end @implementation WelcomeVC - (void)viewDidLoad { [super viewDidLoad]; [self myInit]; } -(void)myInit { NSArray* images = @[@"下载进入页2.png",@"下载进入页3.png"];//@"下载进入页1.png",带安卓属性 UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kSize.width, kSize.height)]; /**跳到第5页,也会欢迎结束 */ [scroll setContentSize:CGSizeMake(kSize.width* images.count+1, 0)]; [scroll setBounces:NO]; [scroll setShowsHorizontalScrollIndicator:NO]; scroll.delegate = self; scroll.pagingEnabled = YES; [self.view addSubview:scroll]; pageControl = [[UIPageControl alloc]initWithFrame:CGRectMake(0, kSize.height-50, kSize.width, 20)]; pageControl.userInteractionEnabled = NO; // pageControl.pageIndicatorTintColor = [UIColor blackColor]; // pageControl.currentPageIndicatorTintColor = [UIColor whiteColor]; pageControl.numberOfPages = scroll.contentSize.width/scroll.frame.size.width; [self.view addSubview:pageControl]; UIImageView* iv; for (int i =0; i 1) { LoginVC * loginvc = [[LoginVC alloc]init]; KWINDOW.rootViewController = loginvc; } } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { pageControl.currentPage = scrollView.contentOffset.x/scrollView.frame.size.width; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end