ios啟動載入啟動圖片

來源:互聯網
上載者:User

標籤:

版本判斷:

    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

ios啟動載入啟動圖片

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.