views:

480

answers:

4

How can I display RTL text(e.g. arabic) in UITextView?

+1  A: 

I am having the same problem here .... I want to set tab bar item's title to some arabic text (right-to-left) but it shows the text from left-to-right.

I copied the text from browser and put it in nib file (Interface builder). It shows perfectly in nib file but when i run it in simulator, text is changed to left-to-right (right-most character gone to left-most)

Any clue?

Imran Raheem
Just a guess - when you switch your device to Arabic locale it displays text right-to-left. So try to set current locale to Arabic programmatically - may be it will work for you
Vladimir
+2  A: 

Ok, i got it right. The simulator version in my xcode was set to 2.2 :S

It's working perfect after I select 3.0.

Cheers!

Imran Raheem
A: 

Did Anyone find any solution for having a Right to Left UITextView. I've found UIControlContentHorizontalAlignment in UIControl that might be the solution. I've not tried it yet.

typedef enum {
   UIControlContentHorizontalAlignmentCenter = 0,
   UIControlContentHorizontalAlignmentLeft    = 1,
   UIControlContentHorizontalAlignmentRight = 2,
   UIControlContentHorizontalAlignmentFill   = 3,
} UIControlContentHorizontalAlignment;

take a look at the docs: http://developer.apple.com/iphone/library/...

please let me know if you find a solution.

Allen Bargi
A: 

Hi,

Does anyone have faced any issue like me?

I am currently showing Arabic content in a label with scroll view, however the full stop which should be displayed at the left hand side, it is being displayed on right hand side (Like LTR Language and not like RTL Language)?

Does anyone have solution...???

Thanks.

Jainam