Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing background color on UIScrollView?

Tags:

iphone

How do I change the black/gray color to white?

This is just a simple view with a UIView attached to the UIViewControllers property together a with a webview that fills the UIView.

UPDATE

Here's the code that works:

- (void)loadView {
UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 416.0f)];
[webView setBackgroundColor:[UIColor whiteColor]];
self.view = webView;
[webview release];
}

Thanks in advance.

iPhone

like image 424
LuckyLuke Avatar asked Dec 21 '22 19:12

LuckyLuke


1 Answers

You can use the UIScrollView's backgroundColor property to achieve this, the signature being:

@property(nonatomic, copy) UIColor *backgroundColor

As such to change it to white, you'd use:

[myScrollView setBackgroundColor:[UIColor whiteColor]];
like image 198
John Parker Avatar answered Jan 07 '23 00:01

John Parker