sectionheader

viewForHeaderInSection creating a memory leak?

旧时模样 提交于 2020-01-01 22:47:14
问题 I am having great success getting the look I want using a custom header view and the delegate method tableView: viewForHeaderInSection:. But I think it is producing a memory leak, and I'm not sure what to do about it. The code is this: - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { NSLog (@"New header, section %d", section); ResultsHeaderView *header = [[ResultsHeaderView alloc] initWithFrame:CGRectMake(0, 0, defaultResultsHeaderSize.width,

Iphone : How to scroll to the 1st cell of the 2nd section, letting the header of the 1st section visible

笑着哭i 提交于 2020-01-01 18:18:27
问题 I have an UITableView with rows and sections. I would like to scroll to the first item of the second section, letting the header of the first section visible. Like if I had manually scrolled the list until reaching that state. ---- TOP OF SCREEN ---- Header of first section Header of the second section cell 1 cell 2 cell 3 Header of the third section cell 1 cell 2 ... scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1] does not do the job, it hides the header of the first

StickyListHeadersListView MultiChoiceMode issue

♀尐吖头ヾ 提交于 2019-12-25 06:07:24
问题 I am using the StickyListHeadersListView android library from github for my application. It was working fine. After I implement MultiChoiceMode listener for copying and deleting elements, there is a problem in highlighting of elements. Whenever I select an element and scroll up and down, some Section Headers are highlighted automatically like shown in the image below How to avoid this behaviour. Is there any steps I'm missing? Need some hand in resolving the issue. My Adapter which extends

UITableView Custom Section Header, duplicate issue

戏子无情 提交于 2019-12-22 05:27:17
问题 I am having trouble animating a custom UITableView section header. The goal was to create collapsable sections. When I tap on the custom header the first time it animates as expected, however every time after that it leaves a duplicate in the original location and animates another. Image Example: My Custom Header: - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView* customView = [[[UIView alloc]initWithFrame:CGRectMake(10.0, 0.0, 300.0, 44.0)

Change UITable section backgroundColor without loosing section Title

纵饮孤独 提交于 2019-12-18 01:13:08
问题 i have changed the backgroundColor/backgroundImage of my tableviews sections. I am using plain tableView. No worries, get worked without problems with this code: -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *sectionView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 728, 40)] autorelease]; sectionView.backgroundColor = [UIColor greenColor]; //For using an image use this: //sectionView.backgroundColor = [[UIColor alloc]

iPhone - UITableViewController - Setting section header in portrait and landscape

守給你的承諾、 提交于 2019-12-12 04:20:51
问题 I'm having UITableView controller which uses custom section header view. When my device is portrait, its showing perfect. And when my device is landscape its perfect again. But when orientation changed during app runtime, its not updating my section view. What's the problem? Using following code, I'm adding a label, and two buttons to a view and returning that view in "viewForHeaderInSection". During debugging I found that the method is getting called, but the section header view is not

UICollectionView Section headers & footers show wrong way - iOS

狂风中的少年 提交于 2019-12-11 06:35:52
问题 The problem is: SupplementaryView has a textLabel on it, but the text appears at a wrong location while header and footer and textLabel just show right. As you can see in the picture, only the first section header has a title, other header or footers text is out of sight(they are on the screen but you have to scroll down to see it). I don't know how to solve it... I setup my collectionview like following in viewDidLoad function: func setupCollectionsView(){ let width:CGFloat = self.view.frame

Invalid nib registered for identifier

我的梦境 提交于 2019-12-11 03:07:22
问题 I'm trying to get a view created in a nib file to be used as a section header in my UITableView. I'm following the 3rd option as described here http://hons82.blogspot.it/2014/05/uitableviewheader-done-right.html But I'm getting this error *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'invalid nib registered for identifier (sectionHeaderIndentifier) - nib must contain exactly one top level object which must be a UITableViewHeaderFooterView instance'

Getting width of a cell in a grouped UITableView for setting section header width

自作多情 提交于 2019-12-10 11:34:04
问题 Header says it all really I just need to get at the cell width of the table so I can set my section header width to be the same + a few pixels. Here is semi pseudo-code for my problem. CustomHeaderView *headerView = [[CustomHeaderView alloc] init]; headerView.frame.width = [tableView getCellFrameWidth] + 10; Been struggling with this all day. Getting at the width of the cells in a grouped tableview seems like it should be a trivial operation, but for some reason is not. Having said that I'm a

Getting width of a cell in a grouped UITableView for setting section header width

我的梦境 提交于 2019-12-08 22:14:28
Header says it all really I just need to get at the cell width of the table so I can set my section header width to be the same + a few pixels. Here is semi pseudo-code for my problem. CustomHeaderView *headerView = [[CustomHeaderView alloc] init]; headerView.frame.width = [tableView getCellFrameWidth] + 10; Been struggling with this all day. Getting at the width of the cells in a grouped tableview seems like it should be a trivial operation, but for some reason is not. Having said that I'm a complete beginner in IOS programming so if some of you veterans out there could explain to me why this