gpt4 book ai didi

iphone - 如何在 iOS 中的 UITableView 上方添加 UIView?

转载 作者:可可西里 更新时间:2023-11-01 04:28:00 24 4
gpt4 key购买 nike

我正在使用 xcode 模板创建一个带有 UINavigationController 的 UITableView 应用程序。

我需要在 UINavigationBar 和 UITableView 之间添加一个 UIView(在固定位置)。怎么做?

谢谢。

enter image description here

最佳答案

您可以通过设置 UITableView 的 tableHeaderView 属性来做到这一点。

UITableView class reference

tableHeaderView

Returns an accessory view that is displayed above the table.

@property(nonatomic, retain) UIView *tableHeaderView

Discussion The default value is nil. The table header view is different from a section header.

Availability Available in iOS 2.0 and later.

关于iphone - 如何在 iOS 中的 UITableView 上方添加 UIView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8412213/

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