8
A
回答
15
方法如下:
//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];
這使用QuartzCore框架,它僅適用於> = OS 3.0
1
你可以在你的webView上添加一些遮罩圖像。以這樣的方式,你可以改變你的web視圖的可見部分的形式
翻新你的整個問題:http://stackoverflow.com/help/how-to-ask – 2015-05-10 00:51:38