ios启动载入启动图片
来源:互联网 发布:中文域名怎么买 编辑:程序博客网 时间:2024/06/06 03:14
版本判断:
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 - 30; 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 =0; i<LaunchImage; i++) {// UIImage *name=[UIImage imageNamed: [NSString stringWithFormat:@"new_feature_%d",i+1]]; NSString *name = [NSString stringWithFormat:@"new_feature_%d",i+1]; 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 =0; theImage.width = imageW; theImage.height = imageH; } theScorll.contentSize = CGSizeMake(LaunchImage *self.view.width,0); 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
0 0
- ios启动载入启动图片
- iOS 启动图载入设置
- IOS 启动图片
- iOS App 启动图片
- iOS设置启动图片
- iOS 设置启动图片
- ios启动图片
- iOS-获取启动图片
- iOS 图片启动页设置
- ios启动图片的延时
- iOS LaunchScreen设置启动图片 启动页停留时间
- iOS LaunchScreen设置启动图片 启动页停留时间
- iOS LaunchScreen设置启动图片 启动页停留时间
- iOS LaunchScreen设置启动图片 启动页停留时间
- iOS 启动图片会影响控制器的启动大小
- iOS程序的启动图片图标设置
- iphone, ipad, ios的启动图片。
- flex ios 加载启动动画或图片
- loadView、viewDidLoad、initWithCoder、initWithNibName、awakeFromNib的用法
- Java Socket网络编程的经典例子(转)
- 什么是一个对象?
- collectionview使用
- 关于delegate(代理)总结
- ios启动载入启动图片
- ios中图片拉伸用法
- 代码搭建记事本框架(二)
- 代码搭建记事本框架(一)
- (转)RVA-相对虚拟地址解释
- BigInger isProbablePrime
- 理解奈奎斯特定理和香农定理
- Ubuntu16.04下配置YouCompleteMe
- ubuntu下安装ctags和taglist