UITableView cornerRadius在iOS上出现边框性能问题 [英] UITableView cornerRadius with border performance issues on iOS
问题描述
我有一些有趣的通知,在 UITableView
上使用 cornerRadius
, borderWidth <滚动性能/ code>和
borderColor
已启用。
I have some interesting notice with scrolling performance on UITableView
with cornerRadius
, borderWidth
and borderColor
enabled.
self.tableView.layer.cornerRadius = 10.f;
self.tableView.layer.borderWidth = 1.0f;
self.tableView.layer.borderColor = [UIColor whiteColor].CGColor;
如果我删除 borderWidth
和 borderColor
比滚动得到60 FPS没问题。只要我将这两个属性添加到图层FPS丢弃。
If I remove borderWidth
and borderColor
than scrolling gets 60 FPS no problem. As long as I add those two properties to layer FPS drops.
有没有人有这样的奇怪行为发生的建议或解释?
Does anyone have a suggestion or explanation why this strange behavior happens?
非常感谢!
推荐答案
我刚刚发现cornerRadius与borderWidth缓慢的tableView性能相差很多。因此,而不是10.f半径我改为5.f并且性能惊人地增加。仍然不完美,但明显更好......
I just found out that cornerRadius with borderWidth sluggish tableView performance by a lot. So instead of 10.f radius I changed to 5.f and performance has increased amazingly. Still not perfect but noticeably better...
这篇关于UITableView cornerRadius在iOS上出现边框性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!