iOS 9中的RTL语言行为 [英] RTL language behavior in iOS 9

查看:85
本文介绍了iOS 9中的RTL语言行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序支持RTL语言,例如阿拉伯语,波斯语.

Our app supports RTL language like Arabic, Persian.

iOS 9之后,导航控制器和选项卡栏控制器的行为已更改.我只找到此链接 ios-9-disable-support-for -right-to-left-language 来解决此问题

After iOS 9 the navigation controller and tab bar controller behavior has been changed. I found only this link ios-9-disable-support-for-right-to-left-language for solve this problem

我在appDelegate中编写了此代码,它可以正常工作,并且导航栏和选项卡栏设置为LTR.

I write this code in my appDelegate and it works fine and navigation bar and tab bar set as LTR.

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

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

But my problem is: I can't change interactive pop gesture Direction .

推荐答案

我在同样的问题上苦苦挣扎,终于找到了解决办法

I was struggling with same problem and finally found solution

您只需要为navigationController.view设置SemanticContentAttribute

you just need to set SemanticContentAttribute for navigationController.view

在rootViewController的viewDidLoad中:

in the rootViewController's viewDidLoad:

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

这篇关于iOS 9中的RTL语言行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆