user65959
user65959

Reputation: 91

UILabel and right to left text

I have a collection of NSString objects that contain arabic text. However, when I try to display any of them using a UILabel, the text shows left-to-right instead of right-to-left (NSLog shows the strings properly)

I am thinking about a work-around, applying a transform to the UILabel to make a y-axis symmetry, but how can I detect if a NSString contains a RTL string?

Upvotes: 0

Views: 1343

Answers (2)

Eric
Eric

Reputation: 736

Try prepending the unicode character 0x200F to the beginning of each string. This character is an invisible marker character that indicates text directionality.

Upvotes: 1

Andrew Grant
Andrew Grant

Reputation: 58786

Have you tried setting your region to Arabic? I would have thought this type of thing would be handled automatically.

Upvotes: 0

Related Questions