NCF*_*USN 4 objective-c storyboard uitableview ios
首先,当滚动tableview超出范围时,我得到内存泄漏.与此处相同的问题.
此外,我的滚动速度足够快,但在我滚动时它有点颤抖.细胞是可重复使用的.
码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
Country *country=[[self.items objectAtIndex:[indexPath section]] objectAtIndex:[indexPath row]];
CountryCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.imageView.image=[UIImage imageNamed:country.countryFlag];
cell.countryName.text=country.countryName;
cell.currencyCode.text=country.code;
cell.currencyOriginalName.text=country.originalUnitName;
return cell;
}
Run Code Online (Sandbox Code Playgroud)
应用程序:iOS 5,ARC,Storyboard.
什么可能是这个tableView行为的真正原因以及如何解决它?
如果设备中的滚动较差,则可能未在原型中正确配置子视图.你没有在上面的方法中做任何昂贵的事情.
使用Core Animation乐器(仅限设备) - 滚动时每秒检查一次帧数.您希望尽可能接近60fps.
打开"颜色混合图层" - 任何绘制透明的图像都将以红色突出显示.如果可能,您希望从单元格中删除所有透明度,并将它们全部变为绿色.这可能只是在原型子视图中正确设置背景颜色和不透明标记.
如果您的图像与图像视图的大小不同,那么每次出现单元格时都会调整大小,这也是一项昂贵的操作.
| 归档时间: |
|
| 查看次数: |
2574 次 |
| 最近记录: |