【发布时间】:2018-02-04 00:10:10
【问题描述】:
我有类似的问题,就像我描述的 here。我再次找不到其他隐藏设置。
我为我的表格视图单元格使用了披露指示器。在装有 iOS 10+ 的 iPhone/iPad 上工作,在装有 iOS 9 的 iPhone 上看起来还不错,但在装有 iOS 9 的 iPad 上就不行了。
我尝试为附件视图设置背景,但还是一样。
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath) as! TablesTableViewCell
cell.accessoryView?.backgroundColor = tableView.backgroundColor
if let tablesTable = fetchedResultsController?.object(at: indexPath) {
currentTableSession = TableSessionTable.getCurrentTableSession(table: tablesTable)
cell.tableNameLabel.text = tablesTable.tableName
print("cell.contant view")
print(cell.contentView.backgroundColor)
print("cell.accessory view")
print(cell.accessoryView?.backgroundColor)
print("tableview.background")
print(tableView.backgroundColor)
根据打印,它是 nil:
cell.contant 视图可选(UIDeviceRGBColorSpace 0.976539 0.977373 0.915492 1) cell.accessory 视图为零
tableview.background 可选(UIDeviceRGBColorSpace 0.976539 0.977373 0.915492 1)
也试过这个:
tableView.cellForRow(at: indexPath)?.accessoryView?.backgroundColor = tableView.backgroundColor
同样的结果。
知道如何解决这个问题吗?
【问题讨论】:
标签: ios uitableview ipad ios9 uiaccessoryview