Skip to content

Instantly share code, notes, and snippets.

@marshluca
Created January 6, 2011 05:23
Show Gist options
  • Save marshluca/767543 to your computer and use it in GitHub Desktop.
Save marshluca/767543 to your computer and use it in GitHub Desktop.
Rounded Corners on UIWebview
// This is required in order to access the CALayer properties
#import <QuartzCore/QuartzCore.h>
// Create UIWebview
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(5, 20, 310, 220)];
// Round corners using CALayer property
[[webView layer] setCornerRadius:10];
[webView setClipsToBounds:YES];
// Create colored border using CALayer property
[[webView layer] setBorderColor:
[[UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1] CGColor]];
[[webView layer] setBorderWidth:2.75];
[[self view] addSubview:webView];
...
[webView release];
http://iPhoneDeveloperTips.com/cocoa/add-rounded-corners-and-border-to-uiwebview.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment