gpt4 book ai didi

ios6 - heightForRowAtIndexPath =0 但它仍然在其行中显示标签

转载 作者:行者123 更新时间:2023-12-04 16:18:41 24 4
gpt4 key购买 nike

我有一个表格 View ,我将所有的奇数单元格高度设置为 0,在奇数单元格中我有一些标签。当它显示表格 View 时,奇数单元格中的标 checkout 现在偶数单元格中。有什么办法可以让标签消失吗?这个问题发生在ios 6
ps:
在 ios 7 中:它工作正常。
我已经有了方法:[tableView beginUpdates]; [tableView endUpdates];

谢谢。

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

// show odd row
if (selectedRow == indexPath.row) return 78;

// hide odd row and show even row
if (indexPath.row %2 ==0){
return 88;}
else{
return 0;}
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{


if (indexPath.row%2 == 0){


//user click on even row -> display the next row
selectedRow = indexPath.row+1;

[tableView beginUpdates];

[tableView endUpdates];

}
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
int index = indexPath.row / 2;

if (indexPath.row %2 ==0){

static NSString *CellIdentifier = @"PhraseViewCell";

PhraseCellVietnamese *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

NSString *phrase = [[phrases objectAtIndex:index] objectForKey:@"vietnamese"];

NSNumber *checkFavorite = [[phrases objectAtIndex:index] objectForKey:@"favorite"];

NSNumber *phraseId =[[phrases objectAtIndex:index] objectForKey:@"_id"];

[cell SetInfo:phrase :checkFavorite.intValue :phraseId.intValue];

return cell;

}
else{

static NSString *CellIdentifier = @"PinyinViewCell";

PinYinViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

NSString *pinyin = [[phrases objectAtIndex:index] objectForKey:@"pinyin"];

NSString *chinese = [[phrases objectAtIndex:index] objectForKey:@"chinese"];

NSString *voice = [[phrases objectAtIndex:index] objectForKey:@"voice"];

[cell setInfo:pinyin :chinese :voice];

return cell;
}
}

最佳答案

[单元格 setClipsToBounds:YES];在 cellForRowAtIndexPath 中

为我工作。希望你找到了你的解决方案。

关于ios6 - heightForRowAtIndexPath =0 但它仍然在其行中显示标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19462711/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com