• [iOS UI进阶


    1.UIView转场过渡动画
    UIViewTransitionAnimation
     
     1 //
     2 //  ViewController.m
     3 //  UIViewAnimationTest
     4 //
     5 //  Created by hellovoidworld on 15/1/16.
     6 //  Copyright (c) 2015年 hellovoidworld. All rights reserved.
     7 //
     8 
     9 #import "ViewController.h"
    10 
    11 @interface ViewController ()
    12 
    13 @property(nonatomic, strong) UIImageView *imageView;
    14 @property(nonatomic, assign) int imageIndex;
    15 
    16 @end
    17 
    18 @implementation ViewController
    19 
    20 - (void)viewDidLoad {
    21     [super viewDidLoad];
    22     // Do any additional setup after loading the view, typically from a nib.
    23    
    24     UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(80, 100, 160, 240)];
    25     imageView.image = [UIImage imageNamed:@"1"];
    26     self.imageView = imageView;
    27    
    28     [self.view addSubview:imageView];
    29    
    30 }
    31 
    32 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    33     self.imageIndex++;
    34     if (self.imageIndex == 3) {
    35         self.imageIndex = 0;
    36     }
    37    
    38     // 指定需要转换动画的控件和动画转换内容
    39     [UIView transitionWithView:self.imageView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromTop animations:^{
    40             self.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d", self.imageIndex+1]];
    41     } completion:nil];
    42 
    43 }
    44 @end
     
     
    2.UIView替换view动画
    UIViewTransitionFromAnimation
    1  
    2     // 带动画替换view
    3     [UIView transitionFromView:self.view toView:self.imageView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromTop completion:nil];
     
     
     
  • 相关阅读:
    bzoj1494 生成树计数 (dp+矩阵快速幂)
    hdu3516 Tree Construction (区间dp+四边形优化)
    luogu3628 特别行动队 (斜率优化dp)
    luogu3195/bzoj1010 玩具装箱(斜率优化dp)
    poj1038 Bugs Integrated,Inc. (状压dp)
    bzoj1597/luogu2900 土地购买 (斜率优化dp)
    bzoj4518/luogu4072 征途(斜率优化dp)
    pandas read_csv
    pandas series和pd.Dataframe区别
    python3 mro
  • 原文地址:https://www.cnblogs.com/hellovoidworld/p/4228907.html
Copyright © 2020-2023  润新知