質問

I am working on an arabic iphone application and I don't know how to display table view and other staff from right to left, any help please?

役に立ちましたか?

解決

Have a look at this answer for how to display right to left text in a UILabel, which is the label class that is used throughout Cocoa touch, including in UITableView cells. You can create the right-to-left string like this (copy & pasted from linked answer):

NSString *str = "1. בבוקר"; //This could be any right-to-left string
NSString *directionalString = [@"\u200F" stringByAppendingString:str];

The unicode character U+200F is an invisible character that indicates the direction of the text, so you can use it at the start of the string to indicate that the text is right-to-left. Then, you can assign the string to wherever:

cell.textLabel.text = directionalString;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top