zoukankan      html  css  js  c++  java
  • swift UIWebView

    //

    //  WebViewController.swift

    //  UIControlDemo

    //

    //  Created by on 14/12/3.

    //  Copyright (c) 2014 马大哈. All rights reserved.

    //

     

    import UIKit

     

    class WebViewController: BaseViewController ,UIWebViewDelegate{

        var web:UIWebView?

        override func viewDidLoad() {

            super.viewDidLoad()

            

            self.title = "WebView"

     

            web = UIWebView(frame: CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height))

            web?.backgroundColor = .whiteColor()

            web?.delegate = self

            web?.scalesPageToFit = true

            self.view.addSubview(web!)

            

            let stringUrl = "http://www.baidu.com"

            let url = NSURL(string: stringUrl)

            let urlRequest = NSURLRequest(URL: url!)

            web?.loadRequest(urlRequest)

     

        }

        

        func webView(webView: UIWebView, didFailLoadWithError error: NSError) {

            

            println("didFailLoadWithError")

            

        }

        

        func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {

            

            println("(request)")

            

            return true

        }

        

        func webViewDidFinishLoad(webView: UIWebView) {

            println("webViewDidFinishLoad")

            

        }

        

        func webViewDidStartLoad(webView: UIWebView) {

            

            println("webViewDidStartLoad")

        }

        

        override func didReceiveMemoryWarning() {

            super.didReceiveMemoryWarning()

     

        }

     

    }

     

  • 相关阅读:
    ALhoViMwaR
    lenovo anti-virus powered by Intel security保护已过期
    python Module turtle has no circle member解决办法
    为什么电脑打出来都是繁体字
    python 学习笔记(七)(函数)
    python 写汉诺塔移动过程
    python 学习笔记(六)(dict,set)
    Vue CLI组件循环引用踩坑,组件未注册问题
    vue package.json脚本赋值变量
    linux服务器安装node环境及项目部署
  • 原文地址:https://www.cnblogs.com/madaha/p/4145956.html
Copyright © 2011-2022 走看看