OGeek|极客世界-中国程序员成长平台

标题: ios - iOS 9 中的 RTL 语言行为 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 11:44
标题: ios - iOS 9 中的 RTL 语言行为

我们的应用支持 RTL 语言,如阿拉伯语、波斯语。

在 iOS 9 之后,导航 Controller 和标签栏 Controller 的行为发生了变化。我只找到了这个链接ios-9-disable-support-for-right-to-left-language为了解决这个问题

我在我的 appDelegate 中编写了这段代码,它工作正常,导航栏和标签栏设置为 LTR。

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
    [[UINavigationBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
    [[UITabBar appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
}

但是我的问题是: 我无法更改交互式弹出手势方向。

enter image description here



Best Answer-推荐答案


我一直在为同样的问题苦苦挣扎,终于找到了解决方案

你只需要为 navigationController.view 设置 SemanticContentAttribute

在rootViewController的viewDidLoad中:

[self.navigationController.view setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
[self.navigationController.navigationBar setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];

关于ios - iOS 9 中的 RTL 语言行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32932463/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4