tags:

views:

243

answers:

2

Hi, I want my webview with Rounded Rectagle Corners.

Any help ?

Thanks in advance...

+1  A: 

you can add some mask image over your webView. in such way you can change form of the visible part of your webView

Morion
+4  A: 

Here's how:

//first, you
#import <QuartzCore/QuartzCore.h>

//.....

//In your method, where you add your UIWebView, do:
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(50, 220, 200, 100)];

//The rounded corner part:
webView.layer.cornerRadius = 5;
webView.clipsToBounds = YES;

//Load a web site:
[webView loadRequest: [NSURLRequest requestWithURL:
               [NSURL URLWithString:@"http://www.stackoverflow.com/"]]];

//yourView is the UIView's superview, might be the window, or anything you want
[yourView addSubview: webView];
[webView release];

This uses the QuartzCore framework, and it only works on >= OS 3.0

luvieere
Thanks luvieere
Nic
Nic
Edited :D now it's >= OS 3.0
luvieere
Hi luvieere, You gave awesome code..!.. I m really interested to know more in layers of view. Can u suggest good articles/documents for that? How and where can I starte Views and layers? Thanks.
cooliPhoneGuy
If you're interested in layers, check out the Quartz 2D Reference at http://developer.apple.com/iphone/library/DOCUMENTATION/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html
luvieere
Thanks luvieere, let me explore it... :)
cooliPhoneGuy