iOS错误的披露背景在iPad上的iTableViewCell和iOS9中
我有我描述过的类似问题。再一次,我找不到另一个隐藏的设置 我在表格视图单元格中使用了显示指示器。在iPhone/iPad上使用iOS 10+,在iPhone上使用iOS 9看起来不错,但在iPad上使用iOS 9就不行了 我试图为accessoryView设置背景,但它仍然是一样的iOS错误的披露背景在iPad上的iTableViewCell和iOS9中,ios,uitableview,ipad,ios9,uiaccessoryview,Ios,Uitableview,Ipad,Ios9,Uiaccessoryview,我有我描述过的类似问题。再一次,我找不到另一个隐藏的设置 我在表格视图单元格中使用了显示指示器。在iPhone/iPad上使用iOS 10+,在iPhone上使用iOS 9看起来不错,但在iPad上使用iOS 9就不行了 我试图为accessoryView设置背景,但它仍然是一样的 override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
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视图可选(UIDeviceRbColorSpace 0.976539 0.977373
0.915492 1)单元。附件视图无tableview.background可选(UIDeviceGBColorSpace 0.976539 0.977373 0.915492 1) 我也试过:
tableView.cellForRow(at: indexPath)?.accessoryView?.backgroundColor = tableView.backgroundColor
同样的结果
你知道怎么解决这个问题吗
我找到了解决办法!
感谢Claude31在苹果开发者论坛上帮助我解决这个问题
最后,我发现可以通过初始化backgroundView和设置颜色来解决此问题:
let backgroundView = UIView()
backgroundView.backgroundColor = tableView.backgroundColor
cell.backgroundView = backgroundView
它起作用了 我找到了解决办法!
感谢Claude31在苹果开发者论坛上帮助我解决这个问题
最后,我发现可以通过初始化backgroundView和设置颜色来解决此问题:
let backgroundView = UIView()
backgroundView.backgroundColor = tableView.backgroundColor
cell.backgroundView = backgroundView
它起作用了