【问题标题】:How to change UITableViewCell indentation direction如何更改 UITableViewCell 缩进方向
【发布时间】:2018-05-17 02:22:01
【问题描述】:

我有一个带有自定义UITableViewCellUITableView。当用户点击重新排序按钮时,我将UITableView isEditing 属性更改为true。这会导致单元格从左到右缩进,并显示重新排序控件:

是否可以更改缩进方向以使其从右向左发生?我试过将UITableViewCell的indentationLevel设置为负数,但是没有效果:

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    indentationLevel = -10
}

或者,另一种选择是将重新排序控件显示在单元格的左侧。

编辑:

我能够使用以下答案将重新排序按钮更改为单元格左侧:https://stackoverflow.com/a/44254401/2716479

【问题讨论】:

标签: ios swift uitableview


【解决方案1】:

我们可以通过定义semanticContentAttribute 属性来做到这一点。见https://stackoverflow.com/a/44254401/2716479

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多