UITableViewCell show white background and cannot be modified on iOS7

后端 未结 14 1388
轻奢々
轻奢々 2020-11-28 18:42

I\'ve implemented a custom table view cell class that inherit from UITableViewCell. The tableview contains a background image, so I want cell\'s background to b

14条回答
  •  醉酒成梦
    2020-11-28 19:04

    The accepted answer did not fix the problem for me. I had to do this:

    1. In the interface builder, select the table view. Then from the attributes inspector, from the View section, set the Background to transparent (0% opacity).

    enter image description here

    1. From the table's data source class cellForRowAtIndexPath method:

      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
          reuseIdentifier:CellIdentifier];
      cell.backgroundColor = [UIColor clearColor]; //Make cell transparent
      

提交回复
热议问题