RTL语言在iOS 9中的行为
我们的应用程序支持阿拉伯语,波斯语等RTL语言。
在iOS 9之后,导航控制器和标签栏控制器行为已经改变。 我发现只有这个链接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]; }
但我的问题是:我不能改变交互式stream行手势方向。
我一直在同样的问题挣扎,终于find解决办法
你只需要为navigationController.view设置SemanticContentAttribute
在rootViewController的viewDidLoad中:
[self.navigationController.view setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight]; [self.navigationController.navigationBar setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
如果你正在创build自定义popup窗口,你可以通过两种方式来处理。
-
在.h文件中定义一个macros,以在运行时检测它是否是RTL语言。
定义IS_RTL [UIApplication sharedApplication] .userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft
然后根据IS_RTL.Like创build自定义布局
if (IS_RTL) //Do Arabic Implementation else //Do other language implementation
- 如果您是从Storyboard创buildUI,那么对首行或尾部空间的设置约束和第一项的值将是尊重语言方向
在Swift中
navigationController?.view.semanticContentAttribute = .forceRightToLeft navigationController?.navigationBar.semanticContentAttribute = .forceRightToLeft
- 现在,testflight库和Xcode 5中没有任何更改说:“找不到-lTestFlight的ld:库”
- Crashlytics:“我们错过了一个dSYM来处理崩溃”
- iTunes Connect – 无法邀请“内部testing人员”进行预发布应用程序
- 在iPhone sdk中resize后获取图像的大小
- 如何在iOS中使用MPMoviePlayerController播放videostream
- GCM推送通知到iOS与content_available(不工作从非激活状态调用)
- 在我的iPhone应用程序中,在iTunes中评估我的应用程序
- 隐藏状态栏并增加UINavigationBar的高度
- “如何使用Cocos2D 2.X制作基于平铺的游戏”使用cocos2d V3制作本教程