版本判断:

    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. CTO干点啥?

    1.负责技术 2.负责人才 3.负责业务(需求) 4.负责组织

  2. CSS+DIV 设计一个简单的个人网页界面

    *{ margin:0px; padding:0px; } body{ background:#e5e6d0; } #header,#menu,#banner,#main,#footer{ margi ...

  3. UE4 4.14 专用服务器没有生成解决办法

    简单说一下UE4 专用服务器的生成(网上也有其它版本的但是在4.14.1 上不管用) 1.用源代码编译的引擎(如何获取百度上有很多介绍)创建一个C++ UE4 工程. 2. 在vs 中找到红色这个文件 ...

  4. 105 董婷婷 第一次Sprint总结

    总结: 经过一个多星期,第一次Sprint在今天结束了,在这次Sprint中我们的工作主要做的是对项目的构建及各种界面的设计和完善,一些比较具体的功能还没有实现.在这次Sprint中因为有上学期合作的 ...

  5. java中final的理解

    final修饰变量表示变量初始化后就不能再改变. 一.对于基础类型来说,用final修饰后其值不可以改变. 1. final int a; a = 5; 2.final int a = 5; 二.对于 ...

  6. osx下配置Cocos2d-x 3.x Android开发环境

    配置前需要准备的 首先需要看一下官网文档 http://www.cocos.com/doc/article/index?type=cocos2d-x&url=/doc/cocos-docs-m ...

  7. glusterfs 内存管理方式

    glusterfs中的内存管理方式: 首先来看看glusterfs的内存管理结构吧: struct mem_pool { struct list_head list; int hot_count; i ...

  8. IntelliJ IDEA 在网页修改数据,但是在浏览器刷新的时候,不能读取到修改之后的数据

    使用IntelliJ IDEA 在网页修改数据,但是在浏览器刷新的时候,不能读取到修改之后的数据? 解决办法:tomcat配置中,On frame deactivation属性选择Update cla ...

  9. BarTender如何将条码下的数字嵌入到条码中

    现今社会,在各种包装箱子.书籍.超市商品等东西上面,必不可少的绝对要数条形码或者二维码了.有时候,根据客户的需求或者其他条件限制等原因,我们需要将BarTender 2016条码下的数字嵌入到条码中. ...

  10. apriori推荐算法

    大数据时代开始流行推荐算法,所以作者写了一篇教程来介绍apriori推荐算法. 推荐算法大致分为: 基于物品和用户本身 基于关联规则 基于模型的推荐 基于物品和用户本身 基于物品和用户本身的,这种推荐 ...