ios - 挂起(卡住)问题 UISemanticContentAttribute = .ForceRightToLeft

标签 ios iphone swift localization ios9

我正在内部切换应用程序语言 (LTR-RTL),然后重新初始化 Storyboard。

这是一段代码:

let semanticContentAttribute: UISemanticContentAttribute = language == .Arabic ? .ForceRightToLeft : .ForceLeftToRight

UIView.appearance().semanticContentAttribute = semanticContentAttribute
UINavigationBar.appearance().semanticContentAttribute = semanticContentAttribute

问题是,所有呈现的 View Controller 在关闭时都会卡住 3-6 秒。

这是什么原因造成的?

最佳答案

不支持在 appearance() 代理上设置 semanticContentAttribute。您将遇到许多其他问题和错误,因为应用程序仍然认为它运行的语言不是您要覆盖的语言。

向您的应用添加语言切换器只会让应用变得更加困惑;用户希望他们的应用程序遵循其设备设置的语言。

关于ios - 挂起(卡住)问题 UISemanticContentAttribute = .ForceRightToLeft,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41565402/

相关文章:

iphone - 另一款 iPhone - CGBitmapContextCreateImage 泄漏

iphone - 用于日出和日落的 Objective-C 库?

ios - 如何使用带委托(delegate)方法的 NSURLSession 连接到 Web 服务?

iphone - iOS - 禁用 UIDocumentInteractionController 选项按钮

ios - 单击 UICollectionCell 上的按钮执行 segue

ios - indexPath 不可变? swift

ios - Swift:委托(delegate)/事件来自 C# 背景

ios - 雪碧/SKScene : How to draw from top-left instead from bottom-left?

ios - 如何在iOS应用中检索iPhone壁纸?

ios - 在 UIPageViewController 中嵌入 UIScrollView 并禁用 pageView 滑动?