【发布时间】:2023-03-24 04:35:01
【问题描述】:
我重写了方法viewForHeaderInSection,我意识到默认情况下它将它添加到UItableView之上,我想将它发送到tableView的后面。有什么想法吗?
这是我的代码:
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIImageView *imageView = [[UIImageView alloc] initWithImage:districtImage];
imageView.frame = CGRectMake(10,10,300,100);
NSLog(@"districtImage=%@",districtImage);
return imageView;
}
编辑
好的,我现在让它向上滚动:
self.tableView.tableHeaderView = imageView;
我现在的问题是标题太大了如何减少它
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{}
似乎没有生效。
【问题讨论】:
标签: ios objective-c uitableview