将 3D 旋转应用于 iPhone 视图 [英] Apply 3D rotation to iPhone view

查看:30
本文介绍了将 3D 旋转应用于 iPhone 视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对 iPhone 中的视图(尤其是 UILabel)应用 3D 旋转.最简单的方法是什么?

I would like apply a 3D rotation on a view (in particular to a UILabel) in iPhone. What's the simplest way to do this?

一个代码示例将不胜感激.

A code example will be much appreciated.

推荐答案

对于 2D 旋转使用:

For 2D rotation use:

//rotate label in 45 degrees
label.transform = CGAffineTransformMakeRotation( M_PI/4 );

有关 3D 转换,请参阅 这个话题:

For 3D transformations see this thread:

CATransform3D _3Dt = CATransform3DMakeRotation(radians(90.0f), 1.0, 0.0, 0.0);

这篇关于将 3D 旋转应用于 iPhone 视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆