Created
January 6, 2011 05:23
-
-
Save marshluca/767543 to your computer and use it in GitHub Desktop.
Rounded Corners on UIWebview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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