zoukankan      html  css  js  c++  java
  • 首次下载动画

    首次下载动画

    #pragma mark 设置首次启动动画
    // NSString *info = [NSBundle mainBundle].infoDictionary[@"CFBundleVersi on"];

    // [NSThread sleepForTimeInterval:5.0f];

    //创建窗口
    self.window= [[UIWindowalloc]init]; self.window.backgroundColor= [UIColor

    whiteColor];
    self.window.frame= [UIScreen

    mainScreen].bounds;

    • //  //获取版本号

    • //  NSString *key = @"CFBundleVersion";

    • //  NSString *lastVersion = [[NSUserDefaults standardUserDefaults]objectForKey:key];

    // NSString *currentVersion = [NSBundle mainBundle].infoDictionary[key];

    //
    // if ([currentVersion isEqualToString:lastVersion]) {

    self.window.rootViewController = [[SPTabBarController alloc] init];
    // }else
    // { self.window.rootViewController =[[WelcomeViewController alloc] init];

    // [[NSUserDefaults standardUserDefaults]setObject:currentVers ion forKey:key];
    // [[NSUserDefaults standardUserDefaults] synchronize];
    // }

    #import "WelcomeViewController.h" #import "SPTabBarController.h" #import "Define.h"
    @interface WelcomeViewController ()

    @property (nonatomic, strong) UIScrollView *welcome;
    @property (nonatomic, strong) UIImageView *next;

    @end

    @implementation WelcomeViewController

    - (void)viewDidLoad { [super viewDidLoad];

    self.welcome = [[UIScrollView alloc] init];

    self.welcome.frame = [UIScreen mainScreen].bounds;

    self.welcome.contentSize = CGSizeMake(3 * kScreenWidth, kScreenHeight);

    self.welcome.pagingEnabled=YES;

    self.welcome.showsHorizontalScrollIndi cator=NO;

    self.welcome.showsVerticalScrollIndica tor=NO;

    self.welcome.bounces=NO;

    for (int i=1; i < 3 + 1; i++) { UIImageView*

    imageView=[[UIImageView alloc]init]; CGFloat imageX = (i - 1) *

    kScreenWidth;
    CGFloat imageY = 0;

    imageView.frame=CGRectMake(imageX, imageY, kScreenWidth, kScreenHeight);

    imageView.image=[UIImage imageNamed:[NSString

    stringWithFormat:@"%d",i]]; [self.welcome

    addSubview:imageView]; /**

    *在最后一张图片添加进入主页的按钮

    */
    if (i == 3){

    [self setupLastImageView:imageView];

    } }

    [self.view addSubview:self.welcome]; }

    -(void)setupLastImageView:(UIImageView*)im ageView

    {
    //在imageView上添加按钮,需要开启用户交互功

    能,UIImageView这个功能默认关闭 imageView.userInteractionEnabled=YES;

    UIButton* btn=[[UIButton alloc]init];

    btn.frame=CGRectMake(0, 0, kScreenWidth, kScreenHeight);

    [btn addTarget:self action:@selector(jumpMainPage) forControlEvents:UIControlEventTouchUpInsi de];

    [imageView addSubview:btn]; }

    - (void)jumpMainPage {

    UIWindow* window =[UIApplication sharedApplication].keyWindow;

    window.rootViewController=[[SPTabBarCo ntroller alloc]init];
    }

    - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning];

  • 相关阅读:
    LeetCode -- 合并区间
    windows + PyCharm安装第三方库libsvm失败的解决方案
    LeetCode--在排序数组中查找元素的第一个和最后一个位置
    LeetCode--搜索旋转排序数组
    LeetCode--单词拆分
    LeetCode--合并K个有序链表
    LeetCode--括号生成
    2015.12.21日官方最新公告!中国骇客云安全响应平台正式上线啦!
    尊敬的朋友们大家好,最新公告!寒龙联盟上线了。
    中国寒龙出品,易语言病毒之末日毁灭杀毒病毒源码,欢迎分享订阅我们的网站,我们会及时发布相关教学的。
  • 原文地址:https://www.cnblogs.com/lidongxiao/p/4949992.html
Copyright © 2011-2022 走看看