Right to Left UI in iPhone (Hebrew)

五迷三道 提交于 2019-12-01 04:06:04

I don't believe that there is a "correct" way of doing this, but here is one solution:

Within the view, create a UIView and add a UITableView to it. Add the UIView as a subView of your "master" view and specify its bounds to be off of the left side of the screen so that all but the indices is clipped by the "master" view. Now all you have to do is add a bit of code to synchronize the two tables when an index from the subview is touched.

Obviously this is not the best solution, but it is one that could work.

Good luck.

Given that the built-in apps don't flip their layout when you switch the UI language to Hebrew, I think you shouldn't do it either. If your app uses a RTL layout while all other apps use a LTR layout, this might be quite confusing.

Maybe Apple will improve their RTL support one day. If you stick to standard controls, you will probably get most of these improvements for free.

I think the subclassing UITableViewCell to get the behaviour you are after is the way around this. It's fairly trivial to do this.

However, I'm not quite sure how Apple would react in terms of approving the application for the AppStore. They have quite strict User Interface Guidelines which state the accessory in a table cell is on the right side of each cell... but I'm sure they would be reasonable with this given your requirement.

I have no experience with right-to-left-text but have you tried to set the text alignment to right?

[cell.textLabel setTextAlignment:UITextAlignmentRight];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!