iOS SB

iOS应用框架之-storyboard、动画效果

2015-08-14  本文已影响490人  河小龙

iOS应用框架之-storyboard、动画效果

storyboard

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    - (void)loadMainFrame
    {
        UIStoryboard *storyBoard
        = [UIStoryboard storyboardWithName:@"User"
                                bundle:[NSBundle mainBundle]];
    
        UINavigationController *nav = storyBoard.instantiateInitialViewController;
        self.window.rootViewController = nav;
    }

IBOutlet, 关键字,指有能力与xib中某个变量关联

自动布局

适应不同的屏幕尺寸

方法

动画效果

[self.window addSubview:self.loginNavigationVC.view];

[UIView animateWithDuration:2 //2s
                 animations:^{
                     self.loginNavigationVC.view.alpha = 0;
                     self.loginNavigationVC.view.frame = CGRectZero;
                     self.loginNavigationVC.view.transform = CGAffineTransformMakeScale(0.1, 0.1);
                 }
                 completion:^(BOOL finished) {
                     self.loginNavigationVC = nil;
                 }];
上一篇 下一篇

猜你喜欢

热点阅读