簡體   English   中英

將 UITableView 和部分方向/對齊方式設置為 RTL(從右到左)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM