UILabel View with rounded corner radius does not work on iOS 17 Beta – Xcode 15 Beta

huangapple go评论59阅读模式
英文:

UILabel View with rounded corner radius does not work on iOS 17 Beta - Xcode 15 Beta

问题

我正在使用一个UILabel视图,并已经设置了它的角半径,以便在运行时属性中使其变成圆角。
这是在iOS 16.x或更低版本(任何iOS 16或更低版本)上的外观。
而这是在iOS 17 Beta上的外观。
点的形状看起来像一个正方形。不知道如何修复这个问题。
已在多台设备上进行测试,只有在iOS 17 Beta上出现了正方形的问题。

英文:

I am using a UILabel view and I have set the corner radius of it so as to make it rounded using runtime attributes.
UILabel View with rounded corner radius does not work on iOS 17 Beta – Xcode 15 Beta

This is how it appears on iOS 16.x or below (any iOS 16 or below).
UILabel View with rounded corner radius does not work on iOS 17 Beta – Xcode 15 Beta

and this is how it looks on iOS 17 Beta.
UILabel View with rounded corner radius does not work on iOS 17 Beta – Xcode 15 Beta

The dot appears like a square. no idea how to fix this.

Tested on multiple devices and the square issue only appears on iOS 17 Beta.

答案1

得分: 3

将这段代码放在创建圆角后:

label.layer.masksToBounds = true
英文:

Put this after creating the corner radius:

label.layer.masksToBounds = true

huangapple
  • 本文由 发表于 2023年6月12日 21:34:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76457201.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定