iOS之旅--首尾式动画初学总结

本文介绍如何使用iOS中的UIView动画方法来创建基本的动画效果,并探讨了更高级的动画技巧,包括翻转、旋转、偏移等效果的实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用首尾式动画

大概有以下 API:

[UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:2];
    
    self.iconBtn.bounds = bounds;
    
    [UIView commitAnimations];


//[UIView setAnimationDuration:5.0];//设置持续时长
//[UIView setAnimationDelay:1.0];//设置延迟
// [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//设置动画块中的动画属性变化的曲线
/*
 typedef NS_ENUM(NSInteger, UIViewAnimationCurve) {
    UIViewAnimationCurveEaseInOut,         // slow at beginning and end
    UIViewAnimationCurveEaseIn,            // slow at beginning
    UIViewAnimationCurveEaseOut,           // slow at end
    UIViewAnimationCurveLinear
 };
 */
//[UIView setAnimationRepeatAutoreverses:NO];//是否回复
//[UIView setAnimationRepeatCount:10];//重复次数
//[UIView setAnimationStartDate:(NSDate *)];//设置动画开始运行的时间
//[UIView setAnimationDelegate:self];//设置代理
//[UIView setAnimationWillStartSelector:(SEL)];//设置动画开始运动的执行方法
//[UIView setAnimationDidStopSelector:(SEL)];//设置动画运行结束后的执行方法




还有一些高级动画,可以实现动画 翻转、旋转,偏移,翻页,缩放,取反的动画效果,后续!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值