UITableView background color does not change

前端 未结 3 570
感情败类
感情败类 2021-01-07 20:30

In a model UIViewController I have the following implementation of loadView (everything is created programmatically):

- (void)loadView {

    // Add Basic Vi         


        
相关标签:
3条回答
  • 2021-01-07 21:06

    You also need to set your UITableView's backgroundView property to nil on recent (since 3.2) versions of iOS.

    As such, adding...

    tbView.backgroundView = nil;
    

    ...should sort your problems.

    That said, if you want to maintain compatibilty with pre-3.2 devices, you should check for the existence of this via the instancesRespondToSelector method before calling it.

    0 讨论(0)
  • 2021-01-07 21:10

    try

    tbView.backgroundView = nil;
    
    0 讨论(0)
  • 2021-01-07 21:17

    Make sure you have the following 3 options set:

    tbView.opaque = NO;
    tbView.backgroundColor = [UIColor clearColor];
    tbView.backgroundView  = nil;
    
    0 讨论(0)
提交回复
热议问题