简体   繁体   English

使用 Xcode 10.3 构建时,NSAttributedString 在 iOS 13 上不可见

[英]NSAttributedString goes invisible on iOS 13 when build with Xcode 10.3

I'm seeing an issue with Xcode 10.3 and iOS 13. With this setup if I use NSAttributedString and set it to a UILabel, the text goes invisible.我看到 Xcode 10.3 和 iOS 13 存在问题。使用此设置,如果我使用 NSAttributedString 并将其设置为 UILabel,则文本将不可见。 Same code will continue to work on lower iOS versions.相同的代码将继续在较低的 iOS 版本上工作。 If the same code is built/deployed using Xcode 11, iOS 13 renders the strings without any issue.如果使用 Xcode 11 构建/部署相同的代码,则 iOS 13 会毫无问题地呈现字符串。 Has anyone run in to this yet OR have potential solutions?有没有人遇到过这个问题或有潜在的解决方案?

// attrlabel : UILabel
let attrStr = NSMutableAttributedString.init(string: str, attributes: [NSAttributedString.Key.textEffect: NSAttributedString.TextEffectStyle.letterpressStyle])
            attrLabel.attributedText = attrStr

I had the same problem.我有同样的问题。 In my case I fixed it by not using.textEfect key, I use.attachment key instead在我的情况下,我通过不使用 .textEfect 键来修复它,而是使用 .attachment 键

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 xcode 版本 10.3 升级到 11.5 时 ios 构建失败 - ios build failed when upgrading xcode version 10.3 to 11.5 在 Xcode 10.3 iOS 13 中使用未解析的标识符“UINavigationBarAppearance” - Use of unresolved identifier 'UINavigationBarAppearance' in Xcode 10.3 iOS 13 使用 NSTextAttachment 时使用 NSKeyedUnarchiver 在 iOS13 上取消归档 NSAttributedString 时出错 - Error unarchiving NSAttributedString on iOS13 with NSKeyedUnarchiver when NSTextAttachment is used 为了使用 iOS 13 SDK 构建我的 react native 应用程序,我将 xcode 从 10.3 升级到 11.5,为什么我的应用程序不起作用? - To build my react native app with the iOS 13 SDK, I upgrade xcode from 10.3 to 11.5, so why my app doesn't work? 缺少 Xcode 10.3 中的 iOS 9 模拟器 - iOS 9 Simulator in Xcode 10.3 missing 从iOS 10.3开始:UIButton忽略NSAttributedString中的负段lineSpacing - As of iOS 10.3: UIButton ignoring negative paragraph lineSpacing in NSAttributedString iOS 13 NSAttributedString 在 UITableViewCell 内无法正常工作 - iOS 13 NSAttributedString not working properly inside UITableViewCell Xcode 无法在运行 iOS 13 的真实 iOS 设备上构建 - Xcode fails to Build on real iOS device running iOS 13 Apple - iOS - 使用XCode 8.2.1在iOS 10.3上进行测试 - Apple - iOS - Testing on iOS 10.3 with XCode 8.2.1 iOS 13暗模式:用于NSAttributedString时,UIColor.link太暗 - iOS 13 dark mode: UIColor.link too dark when used for NSAttributedString
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM