如何在圆内使用网格裁剪圆形状的图像

时间:2018-11-11 12:10:50

标签: ios swift uiimageview

在我的社交媒体应用中,我想要图像裁剪功能,即以Circle形状裁剪图像并在Circle内具有网格。enter image description here

我已经检查过TOCropViewController。但是Grid没有选项。 https://github.com/TimOliver/TOCropViewController

2 个答案:

答案 0 :(得分:2)

我找到了一个解决方案,我们可以在CropView中使用UIGraphicsGetCurrentContext并使用addEllipse方法在CropView中绘制Circle。

这是解决方案的链接。 https://github.com/bhaveshbc/CircleCropView

答案 1 :(得分:0)

在裁剪视图的顶部添加一个CAShapeLayer,然后在该形状图层中添加网格线。

相关问题