For many who use UITableView, unless you’re doing something like a Contacts application, the tableHeaderView (and related, tableFooterView) are rarely used.
What’s even more perplexing (at least when at first experienced), is that these elements are not repainted when a [UITableView reloadData] is issued; you have to manually issue field / image resets yourself.
Sometimes – like when handling a variable amount of data in the header, say for user status messages – you even have to adjust the size of the tableHeaderView in order to accomodate a growing / shrinking amount of real estate.
Here’s the trick:
CGRect headerFrame = self.profile.tableHeaderView.frame;
headerFrame.size.height = self.myStatus.frame.size.height + offset;
self.header.frame = headerFrame;
self.profile.tableHeaderView = self.header;
First, grab the current header frame. Then, adjust the size of the frame (in my example, I’m adjusting the height only). Then, reset the tableHeaderView with the view again.
This is important – the size will not be adjusted until the tableHeaderView (or tableFooterView) variable is reset.
That’s it.
Hope this helps some of you struggling with this not-so-well documented problem
相关推荐
image resizing program
VC代码 resizing_dlg_sample (实用代码源)VC代码 resizing_dlg_sample (实用代码源)VC代码 resizing_dlg_sample (实用代码源)VC代码 resizing_dlg_sample (实用代码源)VC代码 resizing_dlg_sample (实用代码源)VC...
2007年Shai Avidan 和Ariel Shamir论文《Seam Carving for Content-Aware Image Resizing》所提出方法的Matlab代码实现和作者的论文。 效果非常炫,而且代码不长
seam_carving_for_content_aware_image_resizing pdf论文
(a) Image resizing into sizes 2X, 5X, 10X, 0.1X, 0.25X. (b) Image rotation with and without clipping in angles 100, 600, 900, 1100, 1500 (c) Image flipping in x and y axis. (d) Image zooming.
An Easy to Use Image Resizing and Cropping Control.
matlab开发-Resizing。调整图像大小
描述计算机图形resizing seam carving算法的主要思想,并且给出部分主要代码,很好的学习资源。
The view controller's view is covered by a text view. When you tap the text view, the view controller loads a nib file containing an accessory view that it adds to the text view. The accessory view ...
seamcarving image resizing
opencv图像resize重设置大小,重定义代码示例 配合博文7.opencv-图像resizing使用
VC中当窗口大小变化时,调整控件位置和尺寸的类。 外国人写的类。
用progressive resizing提升CNN图像分类器性能,Boost your CNN image classifier performance with progressive resizing in Keras,by Aleksey Bilogur。
resizing TCP’s segments in order to avoid incurring timeout penalty. We evaluate the merits of the aforementioned solutions using ns-2 simulations. Results show that each of our suggested techniques ...
Method to achieve repositioning/resizing of child controls (36KB)
complete configurability, including movement, resizing, rotation and more(OC).zip,ZDStickerView is an Objective-C module for iOS and offers complete configurability, including movement, resizing, ...
商业编程-源码-对话框源代码 resizing_dlg_doc.zip
This should only be used with FocusUnderMouse, as because of a kwin limitation focus can jump and it's impossible to tell which window has focus * 1.1.1: Bugfixes and an attempt to adjust to new or ...
jQuery-Plugin-for-Client-Side-Image-Resizing-canvasResize