- #import <QuartzCore/QuartzCore.h>
- CAGradientLayer *gradient = [CAGradientLayer layer];
- gradient.frame = rect;
- gradient.colors = [NSArray arrayWithObjects:(id)[UIColor blackColor].CGColor,
- (id)[UIColor grayColor].CGColor,
- (id)[UIColor blackColor].CGColor,nil];
- [self.layer insertSublayer:gradient atIndex:0];
//一个section刷新
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];
[tableview reloadSections:indexSetwithRowAnimation:UITableViewRowAnimationA utomatic];
//一个cell刷新
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3inSection:0];
[tableView reloadRowsAtIndexPaths:[NSArrayarrayWithObjects:indexPath,nil]withRowAnimation:UITableViewRowAnimationN one];
本文介绍了如何在iOS应用中使用QuartzCore库实现渐变背景效果,并详细阐述了刷新特定单元格的方法,包括刷新单个单元格和指定节的多个单元格。
1999

被折叠的 条评论
为什么被折叠?



