目标 c:在笔记中添加从右到左的语言



在我的应用程序中,我想像这样添加字符串(包含从右到左的语言文本(到注释:

:شماره کارت
xxxx-xxxx-xxxx-xxxx
محمد کاظمی

这是我的代码:

NSString *shareText = [NSString stringWithFormat:@"%@ :n%@n %@n %@n %@", NSLocalizedString(@"CardPan", @""), [self.card getCardNumberWithDashed], self.deposit.customerName, NSLocalizedString(self.bank.logo, @""), NSLocalizedString(@"ShareBankCard", @"")];
NSMutableArray *sharingItems = [NSMutableArray new];
[sharingItems addObject:shareText];
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
activityController.popoverPresentationController.sourceView = parent.view;
activityController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
activityController.popoverPresentationController.sourceRect = CGRectMake([Functions Dwidth]/2-15, 0, 30, 30);
[parent presentViewController:activityController animated:YES completion:nil];

在我的iPhone中打开笔记并检查我的笔记时,文本保存如下:

:شماره کارت
xxxx-xxxx-xxxx-xxxx
محمد کاظمی

我该怎么办?

似乎没有办法,因为您有一个带有波斯语(RTL(的应用程序,并且您想在iPhone中以英语使用它。因此,Note或iOS的任何其他默认应用程序根据iOS语言设置自己的语言。最后,有一个简单的测试或方法,您可以在阿拉伯语或其他RTL语言上设置iPhone语言,您可以看到您的文本将显示完全良好。

最新更新