我在使用启用了cornerRadius
、borderWidth
和borderColor
的UITableView
时,发现了一些有趣的滚动性能问题。
self.tableView.layer.cornerRadius = 10.f;
self.tableView.layer.borderWidth = 1.0f;
self.tableView.layer.borderColor = [UIColor whiteColor].CGColor;
如果我移除
borderWidth
和 borderColor
,滚动将不会有任何问题,帧率可达60 FPS。只要我添加这两个属性到图层,帧率就会下降。是否有人能提供建议或解释为什么会出现这种奇怪的行为?
非常感谢!
borderWidth
和borderColor
,它会添加额外的操作来绘制边框。cornerRadius
也是同理。 - onegray