IOS开发之----设置UITableView背景色和选中背景色

IOS开发之----设置UITableView背景色和选中背景色

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

 

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

    

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

    

UIView* tempView1=[[UIView alloc] initWithFrame:cell.frame];

tempView1.backgroundColor = [UIColor whiteColor];

    

cell.selectedBackgroundView = tempView1;

posted @ 2015-12-21 17:50  Chen同学最近很忙  阅读(1139)  评论(2编辑  收藏  举报