gpt4 book ai didi

ios - 自定义表格 View 标题的左上角和右上角

转载 作者:行者123 更新时间:2023-11-29 05:23:04 25 4
gpt4 key购买 nike

我想以编程方式向表格 View 标题的左上角和右上角添加圆角。

This the app I am working on The corners I want to add my app

最佳答案

您可以通过实现 willDisplayHeaderView 函数来做到这一点:

func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let headerView = view as! UITableViewHeaderFooterView
headerView.contentView.backgroundColor = UIColor.lightGray
headerView.contentView.layer.cornerRadius = 20
headerView.contentView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
}

关于ios - 自定义表格 View 标题的左上角和右上角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58469061/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com