ios - 更改部分页脚的背景颜色

标签 ios swift uitableview

我想更改剖面 View 中页脚的背景颜色。 将背景颜色设置为白色。

enter image description here

我尝试了以下步骤,但没有一个成功。

  1. viewDidLoad()中添加了代码

    let HEADER_HEIGHT = 100
    tableView.tableHeaderView?.frame.size = CGSize(width:
    tableView.frame.width, height: CGFloat(HEADER_HEIGHT)).
    
  2. view.contentView.backgroundColor = willDisplayHeaderView() 中的 UIColor.white

  3. 更改了 xib 文件中的颜色

  4. heightForFooterInSection

    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        if section > 1 {
            return 10
        }
        return 0
    }
    

请向我提供有关此问题的意见。

最佳答案

主要问题是滚动标题 所以,我把Plain改为Group。还有额外的灰色空间。 我想删除灰色空间。

现在我再次将 Group 更改为 Plain。修复多余的灰色空间。 修复滚动标题。 我在 viewDidLoad() 中添加了以下行 self.automaticallyAdjustsScrollViewInsets = false

关于ios - 更改部分页脚的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47228245/

相关文章:

ios - 如何从源代码正确打开新 Controller ?

iphone - UITableViewCell 中的 UITextView

ios - 如何知道是否在 iOS 6 UITableViewCell 上点击了删除按钮

ios - 从未加密 Realm 迁移到加密 Realm

ios - 在 Swift 中显示和关闭模态视图 Controller

objective-c - 使单元格在 TableView 中出现和消失

ios - VoIP相当于Coretelephony

ios - AVPlayer 的奇怪行为

ios - 检查自定义键盘中 documentContextBeforeInput 中的字符

ios - 将 UIActivityViewIndicator 置于 UITableViewCell 的中心?