开发者

UITableViewDelegate Protocol Reference [ iOS 4.2 Library ]

iwas reading about the tableView protocol in the iOs 4.2 documentation, and i found this sentence, which refers to the "tableView:viewForHeaderInSection:" paragraph:

Discussion The returned object, for example, can be a UILabel or UIImageView object. The table view automatically adjusts the height of开发者_JAVA技巧 the section header to accommodate the returned view object. This method only works correctly when tableView:heightForHeaderInSection: is also implemented.

It doesn't seem to you a little bit misunderstanding?


Yes, it sounds a bit misleading. In fact they say 2 things:

1) We make the header the height of the object you returned for tableView:viewForHeaderInSection:
2) We make the header height you returned in the method tableView:heightForHeaderInSection:.

These are two quite different. But the correct conclusion is:

1) You have to implement heightForHeaderInSection.
2) Your height for each section will be adjusted for the object you return if it is not accommodate to the size you defined in heightForHeaderInSection:.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜