zoukankan      html  css  js  c++  java
  • 第一次进入应用图片轮播效果

    一、在AppDelegate中

    • 获得应用的版本信息,与内存中的版本信息相比,如果不一样则显示轮播图片
    • 第一次进入应用时显示轮播图片。
    	// 此为找到plist文件中得版本号所对应的键
        NSString *key = (NSString *)kCFBundleVersionKey;
        
        // 1.从plist中取出版本号
        NSString *version = [NSBundle mainBundle].infoDictionary[key];
        
        // 2.从沙盒中取出上次存储的版本号
        NSString *saveVersion = [[NSUserDefaults  standardUserDefaults] objectForKey:key];
        
        if([version  isEqualToString:saveVersion]) {
            
            //不是第一次使用这个版本
            
            //不显示状态
            application.statusBarHidden =NO;
            
            //去调用主界面的内容
            UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:[[ViewController alloc]init]];
            self.window.rootViewController = navi;
        }else{
            
        //版本号不一样:第一次使用新版本
        //将新版本号写入沙盒
        [[NSUserDefaults  standardUserDefaults] setObject:version forKey:key];
        [[NSUserDefaults  standardUserDefaults] synchronize];
        //显示版本新特性界面
        self.window.rootViewController = [[NewfeatureViewController alloc] init];
        }
         
    

    二、轮播功能实现

    • 至于图片轮播功能,网上有很多例子,我是在这个博客的基础上更改的 scrollView实现图片轮播功能
    • 由于这个功能不需要循环轮播,可以在pageController的index为3时,停止定时器。
    • 最后一张图片应该有方式直接跳到主页面,添加一个按钮,present到对应的页面.
    - (void)gotoMainViewController {
        UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:[[ViewController alloc]init]];
        [self presentViewController:navi animated:NO completion:nil];
    }
    
  • 相关阅读:
    WebFrom 小程序【分页功能 】
    WebForm 【Repeater】展示数据
    WebForm 小项目【人员管理系统】分析
    WebFrom 【内置对象】— —跳转页面,页面传值
    WebForm 【复合控件】
    WebForm 【简单控件】【表单元素】
    WebForm 基础学习
    js对元素属性.内容的操作。定时器。元素的平级,父级,子集关系。
    常用事件【由浅入深】1
    document 对象
  • 原文地址:https://www.cnblogs.com/wust-zxl/p/6023005.html
Copyright © 2011-2022 走看看