zoukankan      html  css  js  c++  java
  • UIWebView的常用方法

    //webview导航栏类型
    enum
    UIWebViewNavigationType : Int { case LinkClicked case FormSubmitted case BackForward case Reload case FormResubmitted case Other }
    //webview 分页类型
    enum UIWebPaginationMode : Int {
        
        case Unpaginated
        case LeftToRight
        case TopToBottom
        case BottomToTop
        case RightToLeft
    }
    enum UIWebPaginationBreakingMode : Int {
        
        case Page
        case Column
    }
    class UIWebView : UIView, NSCoding, UIScrollViewDelegate, NSObjectProtocol {
        
        unowned(unsafe) var delegate: UIWebViewDelegate?
        
        @availability(iOS, introduced=5.0)
        var scrollView: UIScrollView { get }
        
        func loadRequest(request: NSURLRequest)
        func loadHTMLString(string: String!, baseURL: NSURL!)
        func loadData(data: NSData!, MIMEType: String!, textEncodingName: String!, baseURL: NSURL!)
        
        var request: NSURLRequest? { get }
        //重载
        func reload()
      //停止加载 func stopLoading() //后退 func goBack()
      //前进 func goForward() //能否后退 var canGoBack: Bool {
    get }
     //能否前进 var canGoForward: Bool {
    get }
     //是否在加载
    var loading: Bool { get }
    // 和js的交互
    func stringByEvaluatingJavaScriptFromString(script: String)
    -> String? var scalesPageToFit: Bool

    @availability(iOS, introduced=3.0)

    
    

        var dataDetectorTypes: UIDataDetectorTypes

    
    

        

    
    

        @availability(iOS, introduced=4.0)

    
    

        var allowsInlineMediaPlayback: Bool // iPhone Safari defaults to NO. iPad Safari defaults to YES

    
    

        @availability(iOS, introduced=4.0)

    
    

        var mediaPlaybackRequiresUserAction: Bool // iPhone and iPad Safari both default to YES

    
    

        

    
    

        @availability(iOS, introduced=5.0)

    
    

        var mediaPlaybackAllowsAirPlay: Bool // iPhone and iPad Safari both default to YES

    
    

        

    
    

        @availability(iOS, introduced=6.0)

    
    

        var suppressesIncrementalRendering: Bool // iPhone and iPad Safari both default to NO

    
    

        

    
    

        @availability(iOS, introduced=6.0)

    
    

        var keyboardDisplayRequiresUserAction: Bool // default is YES

    
    

        

    
    

        @availability(iOS, introduced=7.0)

    
    

        var paginationMode: UIWebPaginationMode

    
    

        @availability(iOS, introduced=7.0)

    
    

        var paginationBreakingMode: UIWebPaginationBreakingMode

    
    

        @availability(iOS, introduced=7.0)

    
    

        var pageLength: CGFloat

    
    

        @availability(iOS, introduced=7.0)

    
    

        var gapBetweenPages: CGFloat

    
    

        @availability(iOS, introduced=7.0)

    
    

        var pageCount: Int { get }

     
    protocol UIWebViewDelegate : NSObjectProtocol {
        
        optional func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool
        optional func webViewDidStartLoad(webView: UIWebView)
        optional func webViewDidFinishLoad(webView: UIWebView)
        optional func webView(webView: UIWebView, didFailLoadWithError error: NSError)
    }
  • 相关阅读:
    Delphi 的RTTI机制浅探3(超长,很不错)
    关于跨进程使用回调函数的研究:以跨进程获取Richedit中RTF流为例(在Delphi 初始化每一个TWinControl 对象时,将会在窗体 的属性(PropData)中加入一些标志,DLL的HInstance的值与HOST 进程的HInstance并不一致)
    获得QQ聊天输入框中的内容
    使用Jenkins来构建Docker容器
    各种排序算法汇总
    ASP.NET Web API和ASP.NET Web MVC中使用Ninject
    s性能优化方面的小知识
    算法时间复杂度的计算
    js模块开发
    NET Framework 4.5 五个新特性
  • 原文地址:https://www.cnblogs.com/qzp2014/p/4282994.html
Copyright © 2011-2022 走看看