当前位置:网站首页>3D旋转动画
3D旋转动画
2022-04-22 23:52:00 【~废弃回忆 �༄】
@implementation UIView (****)
- (void)3dBackgroundAnimation:(BOOL)show duration:(CGFloat)duration
{
if (show) {
CGFloat x = self.center.x;
CGFloat y = self.frame.origin.y;
self.layer.anchorPoint = CGPointMake(0.5, 0);
self.layer.position = CGPointMake(x, y);
//起始值
CATransform3D fromValue = CATransform3DIdentity;
fromValue.m34 = -1.f / 300;
fromValue = CATransform3DRotate(fromValue, 0, 1, 0, 0);
// 结束值
CATransform3D toValue = CATransform3DIdentity;
toValue.m34 = -1.f / 300;
toValue = CATransform3DRotate(toValue, 25.f, 1, 0, 0);
// 添加3D动画
CABasicAnimation *transform3D = [CABasicAnimation animationWithKeyPath:@"transform"];
transform3D.duration = duration;
transform3D.fromValue = [NSValue valueWithCATransform3D:fromValue];
transform3D.toValue = [NSValue valueWithCATransform3D:toValue];
self.layer.transform = toValue;
[self.layer addAnimation:transform3D forKey:@"transform3D"];
}
else {
CABasicAnimation *transform3D = [CABasicAnimation animationWithKeyPath:@"transform"];
transform3D.duration = duration;
CATransform3D toValue = CATransform3DIdentity;
toValue = CATransform3DRotate(toValue, 0, 1, 0, 0);
self.layer.transform = toValue;
[self.layer addAnimation:transform3D forKey:@"transform3D"];
}
}
@end
版权声明
本文为[~废弃回忆 �༄]所创,转载请带上原文链接,感谢
https://blog.csdn.net/eastWind1101/article/details/117434883
边栏推荐
- [perseverance challenge] PCIe ask and answer every day (filed on February 2022)
- 【DVCon2020】软件兄弟呐喊:硬件兄弟,请你做个人
- The implementation principle and function of closure and memory leakage
- [dvcon2020] automatic generation method of UVM sequence based on ral
- LeetCode 1446 - 1449
- unbuntu18.04 安装 gamit10.71 problem solution
- Install vs2017 plug-in glsl language integration V0 under Windows 7 10.120. Vsix reported an error: Microsoft visualc. redist. twelve
- [turtle confession collection] "the moon at the bottom of the sea is the moon in the sky, and the person in front of us is the sweetheart." More joy and peace for the rest of your life ~ (with 3 sourc
- Visual studio always conflicts with Sogou input method
- 在windows7下安装vs2017插件 GLSL language integration v0.10.120.vsix报错:microsoft.visualc.redist.12
猜你喜欢
![[leetcode] binary tree, in-depth understanding of the first, middle and last order](/img/a4/91f5bb36a114f23d513f418435c11d.png)
[leetcode] binary tree, in-depth understanding of the first, middle and last order

Install the most complete version of ActiveMQ under the official website in 2022 and the official website access method

STM32F103 independent watchdog

云计算仿真框架CloudSim介绍(截图版)

No module named 'Django is reported when Django specifies the database_ test. settings‘

LabVIEW实现应用程序停止或退出

visual studio 2019恢复默认设置

XPath positioning

Django creates table structure and adds, deletes, modifies and queries database

Visual studio always conflicts with Sogou input method
随机推荐
[transaction management]
[perseverance challenge] PCIe asks and answers every day (filed on March 2022)
彻底解决Failed to execute goal on project xxxxx
51 single chip microcomputer learning_ 4-2 nixie tube dynamic display
LabVIEW controls computer shutdown, hibernation, logout and restart
邦纳超声波传感器T30UXDA
[Objective-C advanced programming] - GCD
分享两道最近做的比较经典的OJ题(排列子序列+字符串中找出连续最长的数字串)
Wechat applet page Jump
Django创建表结构及对数据库增删改查
[experience sharing] share mangopapa's paper learning experience
共轭梯度法(Conjugate Gradients)(4)
Online fox U3D client game configuration loading failed couldn't connect to server
No module named 'Django is reported when Django specifies the database_ test. settings‘
IOT identity awareness
Traceup | a powerful tool to reduce stress and achieve more success and help you get rid of work anxiety
Hello, I want to open an account for crude oil futures. How can I open an account for futures safely and reliably?
Character set (de duplication)
Failed to execute goal on project xxxxx
在windows7下安装vs2017插件 GLSL language integration v0.10.120.vsix报错:microsoft.visualc.redist.12