UITableview 单元格与 arm64 重叠
UITableview cell Overlap on each with arm64
嗨,我正在尝试升级我的应用程序以在添加 arm64 后支持 iOS arm64
Tableview 单元格重叠(在 iPhone 5s , 6 ,6+)
使用 arm64
问题是由于从 32 位到 64 位的精度。
使用 Apple 提供的 typedef 原始类型,使所有 int
为 NSInteger
并浮动为 CGFloat
.
请注意,如果您执行一些计算,应该 return 一个浮点数实际上是 return 一个浮点数,如果您除以 2 int
,它们将 return int
而不是 float
。通常,如果操作数属于不同类型,编译器会将所有操作数提升为最大或最精确的类型。
有几种可能性。如果您要重复使用标签或图像,请在设置下一行的值之前将其设置为 Nil
。
rosterCell.imgContact.image = Nil; // rosterCell is custom tableview cell object
rosterCell.lblContact.text = @"";
另一个原因可能是您没有设置自动布局约束。可能对你有帮助
对于此方法的输出,您应该将 float 更改为 CGFloat:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Now typing
if (indexPath.section >= [self.bubbleSection count])
{
return MAX([UIBubbleTypingTableViewCell height], self.showAvatars ? 52 : 0);
}
// Header
if (indexPath.row == 0)
{
return [UIBubbleHeaderTableViewCell height];
}
NSBubbleData *data = [[self.bubbleSection objectAtIndex:indexPath.section] objectAtIndex:indexPath.row - 1];
return (CGFloat)MAX(data.insets.top + data.view.frame.size.height + data.insets.bottom, self.showAvatars ? 52 : 0);
}
嗨,我正在尝试升级我的应用程序以在添加 arm64 后支持 iOS arm64 Tableview 单元格重叠(在 iPhone 5s , 6 ,6+)
使用 arm64
问题是由于从 32 位到 64 位的精度。
使用 Apple 提供的 typedef 原始类型,使所有 int
为 NSInteger
并浮动为 CGFloat
.
请注意,如果您执行一些计算,应该 return 一个浮点数实际上是 return 一个浮点数,如果您除以 2 int
,它们将 return int
而不是 float
。通常,如果操作数属于不同类型,编译器会将所有操作数提升为最大或最精确的类型。
有几种可能性。如果您要重复使用标签或图像,请在设置下一行的值之前将其设置为 Nil
。
rosterCell.imgContact.image = Nil; // rosterCell is custom tableview cell object
rosterCell.lblContact.text = @"";
另一个原因可能是您没有设置自动布局约束。可能对你有帮助
对于此方法的输出,您应该将 float 更改为 CGFloat:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Now typing
if (indexPath.section >= [self.bubbleSection count])
{
return MAX([UIBubbleTypingTableViewCell height], self.showAvatars ? 52 : 0);
}
// Header
if (indexPath.row == 0)
{
return [UIBubbleHeaderTableViewCell height];
}
NSBubbleData *data = [[self.bubbleSection objectAtIndex:indexPath.section] objectAtIndex:indexPath.row - 1];
return (CGFloat)MAX(data.insets.top + data.view.frame.size.height + data.insets.bottom, self.showAvatars ? 52 : 0);
}