Objective-C CALayer UIView 真实旋转
我正在尝试旋转 UIView 对象,如下图所示 http://i.piccy.info/i7/f8ff7fe488c7c492e6ff6a689bc9cdeb/1-5-2127/60800682/rotation.png
我正在尝试使用 CALayer 的转换,但我得到这样的结果: http://i.piccy.info/i7/bbb672b058fdfdd251cc90f1ce2b9c1f/1-5-2128/9488743/rotate2.png
I'm trying to rotate a UIView object like shown on the image below
http://i.piccy.info/i7/f8ff7fe488c7c492e6ff6a689bc9cdeb/1-5-2127/60800682/rotation.png
I'm trying to use the CALayer's transform but I get something like this:
http://i.piccy.info/i7/bbb672b058fdfdd251cc90f1ce2b9c1f/1-5-2128/9488743/rotate2.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确,您想要向后标题视图(进入屏幕),应该能够实现如下所示的效果:
要实现此效果,您需要直接操作其中一个转换值(m34)。
距离
越小,效果越强。然后您可以绕 x 轴进行旋转变换(倾斜),在本例中为 PI/4 或 45 度。您可以使用度 * M_PI / 180.0 计算任意值 pi。If I understand correctly, you want to title the view backwards (into the screen) an should be able to achieve it something like this:
To achieve this effect you need to manipulate one of the transformation values directly (m34). The lower
distance
gets, the stronger the effect gets. Then you can do the rotation transformation around the x axis (to tilt), in this case PI/4 or 45 degrees. You can calculate arbitrary values pi usingdegrees * M_PI / 180.0
.