UIWebView的常用方法

來源:互聯網
上載者:User

標籤:

//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)}

 

UIWebView的常用方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.