【问题标题】:How to change UITableViewCell Image to Circle in UITableView if width and height are different如果宽度和高度不同,如何在 UITableView 中将 UITableViewCell Image 更改为 Circle
【发布时间】:2016-02-23 07:50:30
【问题描述】:

我的代码是 imv.clipsToBounds=YES; imv.layer.cornerRadius=imv.frame.size.width/2;

imv.layer.borderWidth = 4.0;

【问题讨论】:

    标签: objective-c


    【解决方案1】:

    最好的解决方案是将您的图像视图调整为方形(使用自动布局或手动设置框架),或者更好的是您可以使用带有圆形剪贴蒙版的图像上下文重绘图像,然后您就不会由于您在滚动时重新计算的角半径,旧设备上的性能问题。

    像这里https://stackoverflow.com/a/17722702/384309

    【讨论】:

      猜你喜欢
      • 2014-05-20
      • 2016-03-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-07
      • 2017-01-19
      • 2021-03-08
      • 1970-01-01
      • 2018-10-28
      相关资源
      最近更新 更多