如何缩放 CAShapeLayer [英] How to scale a CAShapeLayer

查看:34
本文介绍了如何缩放 CAShapeLayer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 swift 中,我成功地制作了一个包含在 CAShapeLayer 中的动画 bezier path.我唯一的问题是在其他屏幕尺寸上实现它.有谁知道我如何使用其中的路径缩放 CAShapeLayer ?即,将其缩小为原始尺寸的一半.

In swift I've successfully made an animated bezier path which is contained inside a CAShapeLayer. My only problem is implementing it onto other screen sizes. Does anybody know how I can scale the CAShapeLayer with the path inside of it? i.e. make it half the original size.

推荐答案

使用这个功能:

 var shapelayer:CAShapeLayer
 shapelayer.transform = CATransform3DMakeScale(, ,)

这篇关于如何缩放 CAShapeLayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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