我有类似的问题,就像我在这里描述的那样。我再次找不到另一个隐藏的设置。
我为我的表格视图单元格使用了披露指示器。在装有 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)
根据打印,它是零:
cell.contant 视图可选(UIDeviceRGBColorSpace 0.976539 0.977373 0.915492 1) cell.accessory 视图 nil
tableview.background 可选(UIDeviceRGBColorSpace 0.976539 0.977373 0.915492 1)
也试过这个:
tableView.cellForRow(at: indexPath)?.accessoryView?.backgroundColor = tableView.backgroundColor
结果相同。
知道如何解决这个问题吗?