UIView Animations(storyboard)
来源:互联网 发布:传奇世界双开辅助软件 编辑:程序博客网 时间:2024/05/01 06:41
IOS4.0之前如果要给一个程序添加动画流程
.h文件
@interface ViewController : UIViewController
{
__weak IBOutlet UIView *view1;
__weak IBOutlet UIView *view2;
}
- (IBAction)View1Button:(UIButton *)sender;
- (IBAction)View2Button:(UIButton *)sender;
.m文件
[UIView beginAnimations:@"aa" context:@"gg"]; //设置动画
//以下是动画内容
view1.backgroundColor = [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1]; //随机颜色
CGFloat x = arc4random_uniform(320);
CGFloat y = arc4random_uniform(480);
view1.center = CGPointMake(x,y); //中心点随机
[UIView setAnimationDuration:3]; //动画时间
[UIView commitAnimations]; //动画结束
UIView 分为2中 一种 属性动画{ frame conter等}
第二种 过渡动画 是系统封装好的动画
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:view1 cache:YES];
需要有一个容器,先把已有的容器删除掉,在添加进新的视图
Begin an animation block.
Set the transition on the container view.
Remove the subview from the container view.
Add the new subview to the container view.
Commit the animation block.
0 0
- UIView Animations(storyboard)
- uiview animations
- UIView animations with autolayout
- UIView Key-frame Animations
- UIView Key-frame Animations
- iOS之UIView Animations
- [UIView animateWithDuration:animations:] 与[UIView beginAnimations:context]
- [UIView animateWithDuration:animations:][UIView beginAnimations:context:]
- [UIView animationWithDuration:animations:]使用的注意点
- 【IOS】动画总结:UIView动画(Animations)
- UIView animateWithDuration: delay: options: animations: completion:
- [UIView beginAnimations:context:]与[UIView animateWithDuration:animations:]区别
- [UIView beginAnimations:context:]与[UIView animateWithDuration:animations:]值得注意区别
- StoryBoard 场景下 添加UIView
- 关于UIView的方法animateWithDuration:animations:completion:的说明
- Animations
- Animations
- Animations
- U3D 模型导入及设置
- JavaEE 自学笔记--XML入门
- ORA-08103: object no longer exists
- Java Mail(二):JavaMail介绍及发送一封简单邮件
- 利用SecureCRT上传、下载文件(使用sz与rz命令)
- UIView Animations(storyboard)
- Python单例模式的4种实现方法:
- linux 用户和组的管理操作
- 中转站
- How to Determine the Blocking Session for Event: 'cursor: pin S wait on X' (文档 ID 786507.1)
- vim编辑
- 【索引】Chapter 1. Algorithm Design_General Problem Solving Techniques_Exercises: Beginner
- PyCharm3.0 中文乱码的解决办法
- 开发板作为USB设备模拟网卡(linux usb 网卡)--gadget&&rndis|cdc