Unable to change background color of static table view cell on iOS 7 (iPad)

前端 未结 6 2125
礼貌的吻别
礼貌的吻别 2021-02-05 01:00

I am unable to change the background color of static UITableViewCells on iOS 7, when running on iPad device. You can easily check this with following setup:

  • Make a
6条回答
  •  迷失自我
    2021-02-05 01:53

    just write this line

    [cell setBackgroundColor:[UIColor clearColor]];

    in your function before return statement

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

    Because in iOS7 documentation clearly says that default color of each table cell is white. So, if you want to change it then you have to change it from your code. Remember to set the background property to clear color of your tableview from Utilities > Attributes inspector (on your right side).

    hope it helps... as it worked for me...!

提交回复
热议问题