#import "ViewController.h"
@interface ViewController ()
@property (strong, nonatomic) UIView *contentView;
@property (strong, nonatomic) UIButton *popBtn;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"改变" forState:UIControlStateNormal];
button.frame = CGRectMake(50, 50, 60, 40);
[button addTarget:self action:@selector(changeUIView) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
}
//UIViewAnimationTransitionNone 无效果
//UIViewAnimationTransitionFlipFromLeft 左切换动画
//UIViewAnimationTransitionFlipFromRight
//UIViewAnimationTransitionCurlUp从下向上
//UIViewAnimationTransitionCurlDown从上向下
- (void)changeUIView{
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
[UIView commitAnimations];
}
@end
切换动画
最新推荐文章于 2024-03-29 09:47:49 发布