is groupTableViewBackgroundColor deprecated on iOS 6?

后端 未结 9 1434
-上瘾入骨i
-上瘾入骨i 2020-11-28 09:56

I was just testing my app with iOS 6.0 and Xcode 4.5GM and I have set up a view like this:

[self.view setBackgroundColor:[UIColor groupTableViewBackgroundCol         


        
9条回答
  •  误落风尘
    2020-11-28 10:14

    In iOS6 SKD, comments in UIInterface.h suggest the following:

    Group style table view backgrounds can no longer be represented by a simple color. If you want to have a background in your own view that looks like the table view background, then you should create an empty table view and place it behind your content.

    This method will be deprecated during the 6.0 seed program

    A simple solution is to set the background with equivalent RGB values:

    [self.view setBackgroundColor:[UIColor colorWithRed:215.0/255.0 green:217.0/255.0 blue:223.0/255.0 alpha:1.0]];
    

    You can them set the view background to color to White or whatever you like in the xib to suppress the warning.

提交回复
热议问题