ios - 阿拉伯语/自动布局的本地化

标签 ios localization autolayout arabic

当我在设备(它的语言是阿拉伯语)中运行我的应用程序时,我感到震惊的是,应该在正确方向的对象会向左移动,反之亦然。

后来我意识到是阿拉伯语本地化的自动布局导致了这个问题。

我以编程方式设置自动布局如下:

    [cell.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[labelView(>=100)]-[cellImage(154)]|"
options:0
metrics:nil
views:dics]];


 [cell.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[labelView]"
options:0
metrics:nil
views:dics]];

            [cell.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[cellImage]|"
 options:0                                                                                     metrics:nil
 views:dics]];

我正在使用 Base Storyboard。我怎样才能确定英语和阿拉伯语的方向 提前致谢

最佳答案

我通过简单地添加

解决了阿拉伯语的方向问题

NSLayoutFormatDirectionLeftToRight

作为约束选项的参数

关于ios - 阿拉伯语/自动布局的本地化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20872733/

相关文章:

php - 将图像从 iOS 应用程序上传到 php --- 不太正确 --- 我错过了什么?

ios - UICollectionView 中只有一个粘性 header

iphone - UIWebView 启动时在状态栏下推起

ios - 标签之间相对于 View 中心的最小间距

ios - 自动布局 : How to create a simple UIView over keyboard using Swift

ios - 无法从 ios 中的当前 View Controller 调用导航 Controller

postgresql - 如何在 PostgreSQL 上实现中文全文搜索?

iphone - 密码字段的本地化和错误键盘

ios - 带动画的自动布局 View

iphone - iOS AppStore : How can I add keywords in Arabic to make it searchable using Arabic words?