swift - UILabel 看起来有阴影像素化

标签 swift swift3

你可以在图片中看到,带有阴影的 View 内部的标签看起来像素化(也是 UIButton),而这个阴影 UIView 之外的另一个标签看起来正常。如何去除这种像素化效果?

The pixelated label and button

感谢您的遮阳篷!

最佳答案

确保您没有设置 shouldRasterize 属性; 如果是,则尝试取消设置
来自 Apple Documentation :

should​Rasterize
A Boolean that indicates whether the layer is rendered as a bitmap before compositing.

这可能会使您的标签像素化。

希望对您有所帮助。

关于swift - UILabel 看起来有阴影像素化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43256272/

相关文章:

ios - 在 Xcode 崩溃报告中发现问题

objective-c - # 通过自动创建的 Bridging header 导入 Obj-C 类,Bridging header 似乎能找到它,但 Swift 类不会

swift - 解析 PFSubclassing 不适用于 Swift

ios - 返回使用 PromiseKit 的另一个 promise 的 promise

ios - 在 swift 3.1 中使用 Firebase SDK 对从 snapshot.value 获取的字典数组进行排序

ios - SwiftUI 中带有 UIViewRepresentable 的 UITableView

ios - Swift 5 组合布局 - itemSize 和 groupSize 扭曲项目 subview

ios - 后置摄像头在 Swift 中无法正常工作

ios - 如何根据 UITableView 高度动态设置 UIScrollView 高度?

ios - UITabBar 项目在选择时具有不同的颜色