I develop an iOS application and my native language is Persian (a Right-to-Left language). How can I change UITableView direction to right-to-left in iOS programming?
A UITableView with RTL direction has:
like this :
Is there any UI or programming way to do this?
You can't change the tableview style dinamically, you have to do it in your xib file or storyboard if you have one. If you don't use a storyboard or a xib, and prefer to create the tableview programmatically, specify the style while creating the tableview using the - initWithFrame:style: method.
There are two main base ways to populate a tableview. The more popular is through Interface Building, using a prototype cell UI object. The other is strictly through code when you don't need a prototype cell from Interface Builder.
A view that presents data using rows in a single column.
Try this on Swift 3
tableView.semanticContentAttribute = .forceRightToLeft
or in StoryBoard Cell properties (Semantic dropdown) select "Force Right-To-Left"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With