How to change the webview background color on PhoneGap iOS

Usually when you slide down your app screen, you will see gray, or white color background underneath your application.
You can change it by editing /platforms/ios/CoinWorth/Classes/MainViewController.m file.
Look for – (void)viewDidLoad and edit it like this:

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.webView.backgroundColor = [UIColor colorWithRed:34/255.0 green:37/255.0 blue:43/255.0 alpha:1];
}

This will make the background dark-ish. 34, 37, 43 are rgb values, you need to divide them by 255.0 for UIColor.

To use black color( or any of the basic colors – just google UIColor ), simply do

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

Write a Comment

Comment