iOS簡單加載一個網頁

jopen 11年前發布 | 30K 次閱讀 IOS iOS開發 移動開發

 .h文件中

@property(strong ,nonitomic) UIWebView * webView;

.m文件中

-(void)viewDidLoad

{

self.webview = [[UIWebView alloc]initWithFormat:CGRectmake(0,0,320,480)];



[self.view addSubview:self.webView];





NSUrlRequeast * request = [NSURLRequest requestWithUrl:[NSURL urlWithString:"http://www.baidu.com"]];



//運行一下,百度頁面就出來了

[self.webview loadRequest:request];

}</pre>

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!