您当前的位置: 首页 >  git

xiangzhihong8

暂无认证

  • 0浏览

    0关注

    1324博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Github+Jekyll搭建个人博文网站

xiangzhihong8 发布时间:2016-12-30 22:15:04 ,浏览量:0

在很多的app应用开发中,当第一次启动应用的时候都会来一个引导页,其效果如下图所示。 这里写图片描述

此处,我们使用UIScrollView来实现一个这样的效果,涉及的代码有。 WelcomeViewController.h

#import  

@interface WelcomeViewController : UIViewController 

@end 

逻辑处理WelcomeViewController.m

#import "WelcomeViewController.h" 
#define IMAGECOUNT 3 

@interface WelcomeViewController ()  
@property (nonatomic, strong)UIPageControl *pageControl; 

@end 

@implementation WelcomeViewController 

- (void)viewDidLoad { 
  [super viewDidLoad]; 
  //创建ScrollView 
  UIScrollView *sv = [[UIScrollView alloc] init]; 
  sv.frame = self.view.bounds; 
  //设置边缘不弹跳 
  sv.bounces = NO; 
  //整页滚动 
  sv.pagingEnabled = YES; 
  sv.showsHorizontalScrollIndicator = NO; 

  //加入多个子视图(ImageView) 
  for(NSInteger i=0; i            
关注
打赏
1482932726
查看更多评论
0.0407s