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 is not trivial that would be awesome.
分组的UITableViewCell的宽度取决于表的宽度,并计算为
table.frame.size.width/16.0*14.0
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:section]];
CGRect rect = cell.frame;
NSLog(@"Cell width = %f",rect.size.width);
这些东西总是随时变化的,但是分组后的UITableViewCell
中的UITableView
的宽度是300.0点,自iPhone OS 1.0起就一直存在。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.