设置UITableView背景色和选中背景色

UIView* tempView=[[UIViewalloc]initWithFrame:cell.frame];

tempView.backgroundColor= [UIColorcolorWithRed:230.0/255.0green:247.0/255.0blue:254.0/255.0alpha:1.0];

cell.backgroundView= tempView; //更换背景色 不能直接设置backgroundColor

UIView* tempView1=[[UIViewalloc]initWithFrame:cell.frame];
tempView1.backgroundColor = [UIColor whiteColor];

cell.selectedBackgroundView= tempView1;

//快速排序
+(NSMutableArray *)arrayObject:(NSMutableArray *)array
{
[array sortUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
if ([obj1 integerValue] < [obj2 integerValue])
{
return NSOrderedDescending;
}
else
{
return NSOrderedAscending;
}
}];
return array;
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容