版本判断:

    1.首先你要知道这个键值对的key:id key =   (id)kCFBundleVersionKey;

    2.同过本地的NSBundle取得当前的版本号。

    3.在沙盒中取得对应的版本号。

    4.比较来判断载入情况。

    //首先获取当前版本,从plist中获取
//在bundle中查找获取当前对应的version
id key = (id)kCFBundleVersionKey;
NSDictionary *infoDictionary=[NSBundle mainBundle].infoDictionary;
NSString *currentVersion = [infoDictionary objectForKey:key]; //从沙盒获取的bundle
NSUserDefaults *defaults= [NSUserDefaults standardUserDefaults];
NSString *defaultVersion = [defaults objectForKey:key];
if ([defaultVersion isEqual:currentVersion]) {
self.window.rootViewController = [[CSMainBarController alloc]init];
}else
{
CSLaunchView *indexView = [[CSLaunchView alloc]init];
self.window.rootViewController = indexView; }

1.创建新的类来加载对应的图片。通过UIViveController上套着UIScrollView再套上一个view.

2.加载对应的view

3.加载对应的pagecontroller

//
// CSLaunchView.m
// diary
//
// Created by asheng123 on 15/4/13.
// Copyright (c) 2015年 asheng123. All rights reserved.
// #import "CSLaunchView.h"
#define LaunchImage 4
@interface CSLaunchView()<UIScrollViewDelegate>
@property(nonatomic,weak)UIPageControl *mypage;
@end
@implementation CSLaunchView -(void)viewDidLoad
{
//载入对应的scrollview的一些信息
[self loadScrollView]; //加载一个pagecontrol
[self loadPageControl];
} -(void)loadPageControl
{
UIPageControl *pageControl= [[UIPageControl alloc]init];
self.mypage = pageControl;
pageControl.numberOfPages = LaunchImage;
pageControl.x = self.view.size.width*0.5;
pageControl.y = self.view.size.height - ;
pageControl.pageIndicatorTintColor = [UIColor grayColor];
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
[self.view addSubview:pageControl];
}
-(void)loadScrollView
{
//创建一个scorllview
UIScrollView *theScorll= [[UIScrollView alloc]init];
//设置对应的尺寸
theScorll.frame =self.view.bounds;
theScorll.delegate = self;
CGFloat imageW = theScorll.frame.size.width;
CGFloat imageH = theScorll.frame.size.height;
[self.view addSubview:theScorll];
for (int i =; i<LaunchImage; i++) {
// UIImage *name=[UIImage imageNamed: [NSString stringWithFormat:@"new_feature_%d",i+1]];
NSString *name = [NSString stringWithFormat:@"new_feature_%d",i+];
if(phoneInch)
{
[name stringByAppendingString:@"@2x"];
}
UIImageView*theImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:name]];
[theScorll addSubview:theImage];
theImage.x = imageW*i;
NSLog(@"thescorll width is %f",theScorll.width);
theImage.y =;
theImage.width = imageW;
theImage.height = imageH;
}
theScorll.contentSize = CGSizeMake(LaunchImage *self.view.width,);
theScorll.pagingEnabled =YES;
theScorll.bounces =NO;
theScorll.showsHorizontalScrollIndicator =NO;
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat num = (scrollView.contentOffset.x /self.view.width);
int intPage = (int)(num +0.5); self.mypage.currentPage=intPage;
}
@end

今日单词:mechanism

underpin

notion

encapsulates

corresponds

conform

conventions

lowercase

sequence

traverse

glance

observes

inform

illustration

scenario

establishes

invoked

compliant

scheme

infrastructure

compliant

demonstrates

emits

bitwise

an inspector object

maintain

triggered

proxy

manual

granular

control

nest

fragment

derived property

ios启动载入启动图片的更多相关文章

  1. iOS开发app启动原理及视图和控制器的函数调用顺序

    main()函数是整个程序的入口,在程序启动之前,系统会调用exec()函数.在Unix中exec和system的不同在于,system是用shell来调用程序,相当于fork+exec+waitpi ...

  2. WebGL 启动载入触发更新流程分析

    WebGL 启动载入触发更新流程分析 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载 ...

  3. iOS app 程序启动原理

    iOS app 程序启动原理 Info.plist: 常见设置     建立一个工程后,会在Supporting files文件夹下看到一个"工程名-Info.plist"的文件, ...

  4. Info.plist和pch文件的作用,UIApplication,iOS程序的启动过程,AppDelegate 方法解释,UIWindow,生命周期方法

    Info.plist常见的设置 建立一个工程后,会在Supporting files文件夹下看到一个“工程名-Info.plist”的文件,该文件对工程做一些运行期的配置,非常重要,不能删除 注:在旧 ...

  5. ele.me在IOS浏览器端启动APP的技巧分析

    ele.me在IOS浏览器端启动APP的技巧分析 巧妙利用后台重定向,在schemes启动时提示用户打开,启动不了APP时能够及时跳转至下载页面. 避免报错页面的出现以及用户还没来的及选择就跳转到下载 ...

  6. 怎样做一个iOS App的启动分层引导动画?

    一. 为什么要写这篇文章? 这是一个很古老的话题,从两年前新浪微博开始使用多层动画制作iOS App的启动引导页让人眼前一亮(当然,微博是不是历史第一个这个问题值得商榷)之后,各种类型的引导页层出不穷 ...

  7. iOS App的启动过程

    一.mach-O Executable 可执行文件 Dylib 动态库 Bundle 无法被连接的动态库,只能通过 dlopen() 加载 Image 指的是 Executable,Dylib 或者 ...

  8. IOS第六天(3:scrollView 图片轮播器)

    IOS第六天(3:scrollView 图片轮播器) #import "HMViewController.h" #define kImageCount 5 @interface H ...

  9. iOS 解决LaunchScreen中图片加载黑屏问题

    iOS 解决LaunchScreen中图片加载黑屏问题 原文: http://blog.csdn.net/chengkaizone/article/details/50478045 iOS 解决Lau ...

随机推荐

  1. Cocos2d-x win7 + vs2010 配置图文详解

    Cocos2d-x win7 + vs2010 配置图文详解 下载最新版的cocos2d-x.打开浏览器,输入cocos2d-x.org,然后选择Download,本教程写作时最新版本为cocos2d ...

  2. Linux系统上通知网关更新arp

    经常会有在线更换Linux服务器IP的操作,该操作带来的一个问题是: 我们已经执行了修改IP的操作,但由于网络上(网关)的ARP缓存暂未更新,导致在某一段时间内,该服务器会有网络不通的情况存在. 因此 ...

  3. OpenGL阴影,Shadow Volumes(附源程序,使用 VCGlib )

    实验平台:Win7,VS2010 先上结果截图:    本文是我前一篇博客:OpenGL阴影,Shadow Mapping(附源程序)的下篇,描述两个最常用的阴影技术中的第二个,Shadow Volu ...

  4. 登录phpmyadmin提示: #1045 无法登录 MySQL 服务器

    打开phpmyadmin,进行登录,出现以下问题,提示:#1045 无法登录 MySQL 服务器 或许出现以下错误情况:phpmyadmin:#1045 无法登录 MySQL 服务器.Access d ...

  5. 导出excel表格。

    导出也做了很多遍了,还是发现好记性不如烂笔头,还是记下来. public void exportLog(HttpServletRequest request,HttpServletResponse r ...

  6. Java控制台中输入中文输出乱码的解决办法

    Run---Run Configurations---Common---Encoding---Other---GBK Run Configurations里的Common中将编码方式改成GBK就正常了

  7. [leetcode]Path Sum II

    Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals ...

  8. win版本对比

    Win+R 输入:slmgr.vbs -dlv 显示:最为详尽的激活信息,包括:激活ID.安装ID.激活截止日期slmgr.vbs -dli 显示:操作系统版本.部分产品密钥.许可证状态slmgr.v ...

  9. AT Tool --- android手机发送at指令

    之前网上也有一款类似的软件,估计是华为内部人员开发的,不过很变态,不但只支持华为的几款手机,而且只能发一条AT命令,然后就不让你发了:所以很气愤,今天花了一天时间自己写了这么款程序,而且是支持所有An ...

  10. ORA-00907: 缺失右括号 整理解决

    ORA-00907: 缺失右括号 前言 最近在开发过程中使用oracle数据库,在程序中进行查询数据时遇到了“ORA-00907: 缺失右括号”的问题,但是如果直接把sql语句直接在数据库或PL/SQ ...