iOS-CAShapeLayer抗锯齿? [英] iOS - CAShapeLayer anti-aliasing?

查看:336
本文介绍了iOS-CAShapeLayer抗锯齿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个相邻的菱形形状,我希望它们的边缘无缝地组合在一起。

I have two rhombus shapes next to each other, and I'd like the edges of them to fit together seamlessly.

目前,由于混叠时,即使边缘尽可能靠近,背景也会渗出。我不想重叠这些形状。

At the moment, due to anti-aliasing, the background bleeds through even though the edges are as close together as possible. I'd like not to have to overlap the shapes.

有人有什么建议吗?
谢谢

Does anyone have any tips? Thanks

推荐答案

您应该可以使用类似这样的东西。

You should be able to use something like this.

yourLayer.magnificationFilter = kCAFilterNearest;

您需要先导入质量控制,但可能已经导入。

You'll need to import QC first but you prob already have.

编辑

magnificationFilter
增大内容大小时使用的过滤器。

magnificationFilter The filter used when increasing the size of the content.

@property(copy)NSString * magnificationFilter
讨论
magnificationFilter的可能值在缩放过滤器中显示。默认值为kCAFilterLinear。

@property(copy) NSString *magnificationFilter Discussion The possible values for magnificationFilter are shown in "Scaling Filters". The default value is kCAFilterLinear.

可用性
在iOS 2.0及更高版本中可用。

中声明CALayer.h

Availability Available in iOS 2.0 and later. Declared In CALayer.h

这篇关于iOS-CAShapeLayer抗锯齿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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