iOS开发>>>设置UITableView背景色和选中背景色

来源:互联网 发布:excel表格怎么筛选数据 编辑:程序博客网 时间:2024/04/27 21:49

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;

原创粉丝点击