iOS簡(jiǎn)單加載一個(gè)網(wǎng)頁(yè)的方法

字號(hào):


    .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:""]];
    //運(yùn)行一下,百度頁(yè)面就出來(lái)了
    [self.webview loadRequest:request];
    }