iOS - CAShapeLayer anti-aliasing?

落爺英雄遲暮 提交于 2019-12-24 03:14:09

问题


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


回答1:


You should be able to use something like this.

yourLayer.magnificationFilter = kCAFilterNearest;

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

EDIT

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

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

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



来源:https://stackoverflow.com/questions/14683934/ios-cashapelayer-anti-aliasing

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