gpt4 book ai didi

ios - tableviewcell 中的 View 高度与 ios 7 和 ios 8 不同

转载 作者:可可西里 更新时间:2023-11-01 03:18:36 26 4
gpt4 key购买 nike

我在 tableviewcell 中有一个 uiview。当我使用 ios 8 运行代码时,表 cell 看起来不错并且工作正常。但是,当我尝试在 iOS 7 中运行此代码时,表格 cell 的内容与 cell 的其他内容重叠。

任何人都可以帮助我正确地做到这一点。

附上Tableviewcell截图如下:

view contents overlapping eachother

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

if(!self.customCell){
self.customCell = [self.goalDetailsTableview dequeueReusableCellWithIdentifier:@"GoalDetailsCell"];
}

//Height of cell
float height = 360;
return height;
}

提前致谢。

最佳答案

我自己解决了这个问题。

在ios7中运行时,只需在tableViewCell实现文件中设置maskToBounds = YES即可。

- (void)layoutSubviews
{
self.cardDetails.layer.masksToBounds = YES;
}

关于ios - tableviewcell 中的 View 高度与 ios 7 和 ios 8 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27290143/

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