Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS错误的披露背景在iPad上的iTableViewCell和iOS9中_Ios_Uitableview_Ipad_Ios9_Uiaccessoryview - Fatal编程技术网

iOS错误的披露背景在iPad上的iTableViewCell和iOS9中

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 {

我有我描述过的类似问题。再一次,我找不到另一个隐藏的设置

我在表格视图单元格中使用了显示指示器。在iPhone/iPad上使用iOS 10+,在iPhone上使用iOS 9看起来不错,但在iPad上使用iOS 9就不行了

我试图为accessoryView设置背景,但它仍然是一样的

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
它起作用了