星空网 > 软件开发 > 操作系统

iOS的过渡动画

iOS中的动画:http://my.oschina.net/aofe/blog/270412

在app中应用了CATransition类来实现 addSubview的动画。

-(void)transitionView_from:(UIView*)one to: (UIView*)two {

CATransition *anim = [CATransition animation];

anim.delegate = self;

anim.duration = 0.4f; //动画持续时间

anim.type = kCATransitionMoveIn; //动画样式

anim.subtype = kCATransitionFromTop; //动画过度方向

anim.startProgress = 0.6 ; //动画开始于60%进度

anim.endProgress = 1; //动画结束于100%进度

NSInteger index_twoView = [[self.view subviews] indexOfObject : two ] ;

NSInteger index_oneView = [[self.view subviews] indexOfObject : one ] ;

 

[self.view echangeSubviewAtIndex : index_oneView withSubviewAtIndex: index_twoView ]; //动画为two进入,one退出。

[self.view.layer addSAnimation: anim forKey: @"animation"]; //开始动画

 

}


 

不过我不喜欢如下图的阴影效果:

iOS的过渡动画images/loading.gif' data-original="http://images2015.cnblogs.com/blog/785982/201509/785982-20150906163515842-1970894239.png" />

但是UINavigationController是如何通过CATransition实现过渡效果的?是否有取消阴影的办法?




原标题:iOS的过渡动画

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

阿里国际站召回Kimplay恐龙蛋玩具商品:https://www.kjdsnews.com/a/1667438.html
亚马逊最新推出"Sponsored TV"广告功能:https://www.kjdsnews.com/a/1667439.html
Keith专场!!Sheena Pike版权画,案件号:23-cv-15837、23-cv-15839:https://www.kjdsnews.com/a/1667440.html
多个亚马逊爆品已被国人注册外观专利,跨境卖家警惕风险!2023-11-14最新!:https://www.kjdsnews.com/a/1667441.html
2023.11.20亚马逊选品推荐(仅供参考)餐椅垫:https://www.kjdsnews.com/a/1667442.html
Temu跃居澳大利亚第三大电商,赶超本土巨头:https://www.kjdsnews.com/a/1667443.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
中国有哪些著名的酒店品牌。:https://www.vstour.cn/a/411242.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流