launching UIWebview with specific url

前端 未结 1 1772
情书的邮戳
情书的邮戳 2021-02-14 14:00

I currently have a view with four buttons, and would like to be able to launch UIWebview with a specific url for each different button.

I currently am able to launch saf

1条回答
  •  野的像风
    2021-02-14 14:32

    somtheing like this should be called in the IBAction for the buttom click. you can specify a different URL based on the sender

    UIWebView *webView = [[UIWebView alloc] initWithFrame: CGRectMake(0.0, 0.0, 1.0, 1.0)];  
    webView.delegate = self;
    
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString: @"www.url.com"] cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: myTimeoutValue];  
    [self.webView loadRequest: request];  
    

    0 讨论(0)
提交回复
热议问题