我在 swift 中创建了一个 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
}
关于ios - 将 UITableView 和截面方向/对齐方式设置为 RTL(从右到左),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28615050/