[英]Setting UITableView and section direction/alignment to be RTL (Right to Left)
我快速創建了一個 UITableView,我知道我可以像這樣改變單元格方向:
cell.textLabel?.textAlignment = NSTextAlignment.Right
但是我怎樣才能做到這一點呢? 和/或整個桌子?
我遵循@ReyGonzales 評論並實現了以下tableView:viewForHeaderInSection
:
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
var title: UILabel = UILabel()
title.text = "SomeText"
title.textAlignment = NSTextAlignment.Right
return title
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.