如何解决不能圆角并且在ASDisplayNode上具有背景色
我试图在设置背景色的同时创建一个带有圆角的ASDisplayNode。但是,拐角永远不会显示为圆角。为什么是这样?我的代码:
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class,DataSourceTransactionManagerAutoConfiguration.class})
这只会创建一个没有圆角的矩形...
解决方法
删除此行
self.cornerRoundingType = .precomposited
我不太确定cornerRoundingType也是如何预合成的
在代码文档中所述
* - ASCornerRoundingTypePrecomposited: corners are drawn using bezier paths to clip the content in a
* CGContext / UIGraphicsContext. This requires .backgroundColor and .cornerRadius to be set. Use opaque
* background colors when possible for optimal efficiency,but transparent colors are supported and much
* more efficient than CALayer. The only limitation of this approach is that it cannot clip children,and
* thus works best for ASImageNodes or containers showing a background around their children.
*
在仓库issue中也有人问这个问题
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。