-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
在这个地方,我想动态添加一个按钮来增加单元格的高度,所以当用户单击该按钮时,应该增加单元格的高度,然后再次单击以调整高度。如何增加和调整iphone中的tableview单元格?
-(void)IncreaseCell
{
UIButton *DownArrow = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[DownArrow addTarget:self
action:@selector(IncreaseCell:)
forControlEvents:UIControlEventTouchDown];
//[DownArrow setTitle:@"Arrow" forState:UIControlStateNormal];
DownArrow.frame = CGRectMake(121.0, 112.0, 72.0, 37.0);
[cell.contentView addSubview:DownArrow];
UIImage *buttonDown = [UIImage imageNamed:@"friendsDownArrowButton.png"];
[DownArrow setBackgroundImage:buttonDown forState:UIControlStateNormal];
[cell.contentView addSubview:DownArrow];
}
是要实现折叠/展开的行选择??? –
是的,请您建议我 –
您是否需要关于此问题的更多帮助?如果其中一个答案解决了您的问题,请接受它。 –