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;
}
网友评论