UIWebView---iOS controls for displaying Web pages

Source: Internet
Author: User

UIWebView is the basic control for displaying Web pages in iOS, providing a very simple and efficient way to use them.

First of all, to build a UIWebView Iboutlet in storyboard now, and associate with Viewcontroller.

Then there is the code execution process:

WebView is connected to storyboard var webview:uiwebview!
First set the WebView style, such as webview!. frame = self.view.framewebview!. BackgroundColor = Uicolor.graycolor ()//Add WebView to Self.view, and then load URLRequest. Self.view.addSubview (webView) var url = "http://www.dianping.com" urlrequest = Nsurlrequest (Url:nsurl (string:url)!) webview!. Loadrequest (URLRequest)

You can then display the specified Web page on the view.

In addition, there are a number of more advanced features, such as the advanced features of WebView, adding more navigation to the web, and so on. Not recorded for the time being, then fill it up later.

UIWebView---iOS controls for displaying Web pages

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.