为什么UITableView部分标题中有足够的空间? [英] Why do I have an excessive amount of space in a UITableView section header?
问题描述
我使用 UITableView
控件来显示用户可以从中选择的客户列表。我把它分成了几个部分,因为他们需要选择的客户每天都会有所不同 - 因此这些部分用于划分天数。
I have used a UITableView
control to show a list of customers that the user can select from. I've divided this into a number of sections, because the customers they need to select will vary from day to day — so the sections are used to divide between the days.
由于某种原因,节标题中包含了过多的空白。我不记得iOS 5(此应用程序最初开发时)的情况。
For some reason, there's an excessive amount of whitespace being included in the section header. I don't recall this being the case with iOS 5 (which this application was originally developed with).
任何人都可以向我推进正确的方向吗?
Can anyone nudge me in the right direction?
FWIW,我没有提供 heightForHeaderInSection:
方法,所以这不是那么简单。在 titleForHeaderInSection:
方法中,我返回一个简单的 NSString *
,它代表日期。
FWIW, I'm not suppling a heightForHeaderInSection:
method, so it's not that trivial. In the titleForHeaderInSection:
method I'm returning a simple NSString*
which represents the date.
推荐答案
我使用了链接到@Larme提供的问题18388429 ,并阅读那里的建议。
I used the link to question 18388429 provided by @Larme, and read through the suggestions there.
对我来说简单的解决方法是关闭视图中的调整滚动视图插图。这给了我我追求的结果。
The simple fix for me was to turn off 'Adjust Scroll View Insets' for the view. That gave me the result I was after.
这篇关于为什么UITableView部分标题中有足够的空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!