不能圆角并且在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中也有人问这个问题

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...