【发布时间】:2014-03-14 07:14:30
【问题描述】:
我的 UITextView 中有一个奇怪的输出,当使用希伯来字符时,如果我在控制台中打印它,我会得到正确的结果:
“אסף השמן 13 小时前说:”
但是当显示在我的 UITextView 中时,它会像这样打印:
有什么想法吗?
UITextView * textView = [[UITextView alloc] initWithFrame:CGRectMake(x, y , width, g.height)];
[textView setBackgroundColor:[UIColor clearColor]];
[textView setUserInteractionEnabled:NO];
[textView setFont:font];
[textView setTextColor:color];
[textView setTextAlignment:NSTextAlignmentRight];
[textView setText:textContent];
[scrollView addSubview:textView];
【问题讨论】:
-
你能记录下文本视图中显示的确切字符串吗?
-
我不明白你。我已经包含了一个屏幕截图。
-
你为什么要向右对齐?左对齐
[textView setTextAlignment:NSTextAlignmentLeft]; -
因为希伯来语是一种从右到左的阅读语言,所以你必须向右对齐。
标签: ios iphone objective-c nsstring unicode-string