UIView perspective

♀尐吖头ヾ 提交于 2019-12-12 05:43:23

问题


I've got an UIView and I want to add perspective to it. Basically I got 4 other views that the user will drag in order to create the perspective. I'd like to indicate 4 points where the UIView's corners will be. I investigated it and I figured out I have to use CALayer to do that, but I'm still no clearer on how to create this kind of transform on an iPhone. Any help, pointers or example code snippets would be really appreciated!

Thanks!


回答1:


Start off by taking a look at the pertinent documentation for CATransform3D. You will create such a transform that describes your perspective and set the CALayer's -transform property to it. (Note that this is distinct from the UIView's -transform which is a CGAffineTransform, not a CATransform3D.)

Come back with code if you still encounter difficulties. :-)



来源:https://stackoverflow.com/questions/9847851/uiview-perspective

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!