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;

相关文章:

  • 2022-12-23
  • 2021-06-24
  • 2022-02-07
  • 2021-09-03
  • 2022-01-20
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
相关资源
相似解决方案