What is the problem with groupTableViewBackgroundColor on iPad?

My background color is white! What for? Just launch the new View-based iPad app and set the background color to viewDidLoad.

- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; } 

What's wrong. If I installed it in redColor, it will work. Why?

+4
source share
2 answers

groupTableViewBackgroundColor on the iPad (or at least on the iPad with iOS 4.2) matches the clearColor , not the template used on the iPhone. You can create a β€œcolor” using your own wallpaper using the UIColor colorWithPatternImage: method.

+7
source

groupTableViewBackgroundColor does not work for iPad. This is an iPhone only. You can use instead

 UIColor *clr = [UIColor colorWithRed:0.875 green:0.88 blue:0.91 alpha:1]; [[self view] setBackgroundColor:clr]; 
0
source

Source: https://habr.com/ru/post/1337765/


All Articles