代码库> 视图动画> ICETutorial:实现类似Path3.x中使用的app新手引导
ICETutorial:实现类似Path3.x中使用的app新手引导
关注
查看次数:6111 下载次数:427
上传时间:2013-09-10 大小:2 KB

这个例子可以帮助你实现类似Path 3.x中新手引导的效果,初始进入app中,是由多张图片组成的新手引导,可以通过手指的滑动切换图片。

特点
可以自定义插入多张图片
您可以使用UIimageView代替例子中的标题,也可以删除例子中的标题
每页的滚动次标题,可自定义文本,字体以及颜色
自动滚动图片(可以选择打开这个功能或者关闭)
图片切换时是淡入淡出的效果
可以简单的使用block来获取按钮的事件

安装
代码都有英文注释,您可以自己阅读。所有可用的设定都可以在头部ICETutorial.h :找到


文本以及图片
  


    // Init the pages texts, and pictures.
    ICETutorialPage *layer1 = [[ICETutorialPage alloc] initWithSubTitle:@"Picture 1"
                                                            description:@"Champs-Elysées by night"
                                                            pictureName:@"tutorial_background_00@2x.jpg"];
    ICETutorialPage *layer2 = [[ICETutorialPage alloc] initWithSubTitle:@"Picture 2"
                                                            description:@"The Eiffel Tower with
cloudy weather"
                                                            pictureName:@"tutorial_background_01@2x.jpg"];
    [...]




次标题的样式以及描述


    // Set the common style for SubTitles and Description (can be overrided on each page).
    ICETutorialLabelStyle *subStyle = [[ICETutorialLabelStyle alloc] init];
    [subStyle setFont:TUTORIAL_SUB_TITLE_FONT];
    [subStyle setTextColor:TUTORIAL_LABEL_TEXT_COLOR];
    [subStyle setLinesNumber:TUTORIAL_SUB_TITLE_LINES_NUMBER];
    [subStyle setOffset:TUTORIAL_SUB_TITLE_OFFSET];

    ICETutorialLabelStyle *descStyle = [[ICETutorialLabelStyle alloc] init];
    [descStyle setFont:TUTORIAL_DESC_FONT];
    [descStyle setTextColor:TUTORIAL_LABEL_TEXT_COLOR];
    [descStyle setLinesNumber:TUTORIAL_DESC_LINES_NUMBER];
    [descStyle setOffset:TUTORIAL_DESC_OFFSET];

    // Load into an array.
    NSArray *tutorialLayers = @[layer1,layer2,layer3,layer4,layer5];




初始化以及加载



    self.viewController = [[ICETutorialController alloc] initWithNibName:@"ICETutorialController_iPhone"
                                                                  bundle:nil
                                                                andPages:tutorialLayers];

    // Set the common styles, and start scrolling (auto scroll, and looping enabled by default)
    [self.viewController setCommonPageSubTitleStyle:subStyle];
    [self.viewController setCommonPageDescriptionStyle:descStyle];

    // Set button 1 action.
    [self.viewController setButton1Block:^(UIButton *button){
        NSLog(@"Button 1 pressed.");
    }];

    // Set button 2 action, stop the scrolling.    
    __unsafe_unretained typeof(self) weakSelf = self;
    [self.viewController setButton2Block:^(UIButton *button){
        NSLog(@"Button 2 pressed.");
        NSLog(@"Auto-scrolling stopped.");

        [weakSelf.viewController stopScrolling];
    }];

    // Run it.
    [self.viewController startScrolling];





标题位于 ICETutorial.m文件中


// Setup the Title Label.
- (void)setOverlayTitle{
    // ...or change by an UIImageView if you need it.
    [_overlayTitle setText:@"Welcome"];
}





有疑问的话可以联系作者 patrick.trillsam@gmail.com.


下载:
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0
综合评论
提示
sina weixin mail 回到顶部