iphone - UITableView 部分标题 iOS 5

标签 iphone objective-c ios5 uitableview

我有多个表委托(delegate)给 UIViewController。在 IOS4 中,我使用函数:(UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 来更改某些表头部分的背景。在那些没有部分的部分中,我返回 nil 并且一切正常。

在 IOS5 中,如果我返回 nil,系统会放置一个默认的标题部分。如何在只有一个部分的表格中隐藏标题部分?

最佳答案

根据发行说明,您的 UITableViewDelegate 必须 现在从 tableView:heightForHeaderInSection:

返回 0.0
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.0;
}

看起来真的很痛苦。我不知道他们为什么要改变这个,因为每个人都依赖于先前的行为 - 但他们必须有他们的理由。

关于iphone - UITableView 部分标题 iOS 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7165034/

相关文章:

iphone - iOS 5 中 Xcode 4.2 中的新 "objects library"

ios5 - UINavigationController 内的 UITableViewController 下面的 iAd

ios - 检测以纵向或横向全屏播放的视频

ios - didReceiveRemoteNotification :fetchCompletionHandler: but the completion handler was never called

ios - id myObj<MyProtocol> vs if([obj 类]符合ToProtocol :@protocol(MyProtocol) )

ios - 什么是 NSAssert1?

iphone - iOS 当应用程序位于前台时,我可以使用本地通知播放声音吗

ios - 无法构建 Cordova ios。错误65

ios - UIView 内容模式在覆盖 drawRect : 时表现不同

objective-c - 在 iOS7 的编辑模式下,UITableViewCell 内容与删除按钮重叠