Transparent background in grouped UITableView - iPhone

前端 未结 4 1817
再見小時候
再見小時候 2020-12-30 00:50

I want to make the grouped UITableView transparent. I partially succeded with the following code:

UIColor *bgColor = [[UIColor alloc] initWithWhite:1 alpha:0         


        
4条回答
  •  [愿得一人]
    2020-12-30 01:52

    I had this issue and found that there was no difference between using:

    [[UIColor alloc] initWithWhite:1 alpha:0.0];
    

    and using:

    [UIColor clearColor];
    

    I tried both of these and still had the little black corners on my table view.

    I also tried setting the backgroundView to nil as suggested, but this didn't work either.

    I solved this by setting the backgrounds of the individual cells to transparent in the cellForRowAtIndexPath method:

    cell.backgroundColor =  [UIColor clearColor];
    

    Of course, this has the side effect that your cells themselves are transparent, which isn't ideal for everyone, but it ok for me in this case.

提交回复
热议问题