IOS: UIWebView of Page view controls

Source: Internet
Author: User

Web Page view Control: UIWebView

function: It is inherited from UIView, and is used as a Web page to display data that is loaded from the network or locally.
enumeration://Page view navigation typetypedef ns_enum (Nsinteger, uiwebviewnavigationtype) {

uiwebviewnavigationtypelinkclicked, //user clicked on a link

uiwebviewnavigationtypeformsubmitted, //user submits a form

Uiwebviewnavigationtypebackforward, //user strikes forward or Back button

Uiwebviewnavigationtypereload, //user hit reload button

uiwebviewnavigationtypeformresubmitted, //user submits the form repeatedly

Uiwebviewnavigationtypeother //Other behavior types occur

};

when the page exceeds the view size, it is partially paged Layout Mode

typedef ns_enum (Nsinteger, Uiwebpaginationmode) {

uiwebpaginationmodeunpaginated, //Do not use page flipping

Uiwebpaginationmodelefttoright, //From left to right

Uiwebpaginationmodetoptobottom, //from top to bottom

Uiwebpaginationmodebottomtotop, //From bottom to top

Uiwebpaginationmoderighttoleft //From right to left

};

Enumeration WebView whether a page has CSS properties when the page is loaded with a style or a column style

typedef ns_enum (Nsinteger, Uiwebpaginationbreakingmode) {

Uiwebpaginationbreakingmodepage, //Page mode

Uiwebpaginationbreakingmodecolumn //Column mode

};

@interface Uiwebview:uiview <nscoding, uiscrollviewdelegate>

Property:

Agent

@property (nonatomic, assign) ID <UIWebViewDelegate> delegate;

built-in scrolling view

@property (nonatomic, ReadOnly, retain) Uiscrollview *scrollview;

Is it possible to return to the previous level

@property (nonatomic, ReadOnly, getter=cangoback) BOOL cangoback;

Whether you can jump to the next level

@property (nonatomic, ReadOnly, Getter=cangoforward) BOOL CanGoForward;

whether to load

@property (nonatomic, ReadOnly, getter=isloading) BOOL loading;

Whether to scale the page to the appropriate size

@property (nonatomic) BOOL scalespagetofit;

do you find a phone number

@property nonatomic) BOOL detectsphonenumbers;

Data link type, such as mailbox, phone, address, etc.

@property (nonatomic) uidatadetectortypes datadetectortypes;

whether to allow built-in media playback

@property (nonatomic) BOOL allowsinlinemediaplayback;

Does the media Video play automatically

@property (nonatomic) BOOL mediaplaybackrequiresuseraction;

does media Audio support airplay

@property (nonatomic) BOOL mediaplaybackallowsairplay;

whether to load data like a memory rendering interface

@property (nonatomic) BOOL suppressesincrementalrendering;

whether to set user interaction

@property (nonatomic) BOOL keyboarddisplayrequiresuseraction;

page Paging mode beyond the view

@property (nonatomic) Uiwebpaginationmode Paginationmode;

Page break mode

@property (nonatomic) Uiwebpaginationbreakingmode Paginationbreakingmode;

Page length

@property (nonatomic) cgfloat pagelength;

The interval between page breaks

@property (nonatomic) cgfloat gapbetweenpages;

number of page pages

@property (nonatomic, readonly) Nsuinteger PageCount;

Method:

Load a Web page from a remote URL (load Web page data: the first way)

-(void) Loadrequest: (nsurlrequest *) request;

Loads footage, such as images referenced in an HTML file, into strings (loading Web page data: The second way), based on the URL path set

-(void) loadhtmlstring: (NSString *) string BaseURL: (Nsurl *) BaseURL;

//data for file data, mimetype is a file type, Textencodingname is the encoding type, BaseURL is the footage path (loading Web page data: The Third Way)

-(void) LoadData: (NSData *) data MIMEType: (NSString *) MIMEType textencodingname: (NSString *) Textencodingname BaseURL: ( Nsurl *) BaseURL;

Reload

-(void) reload;

Stop loading

-(void) stoploading;

Back to previous level

-(void) goBack;

Jump to the next level

-(void) GoForward;

Manipulating Web page data with JavaScript

-(NSString *) stringbyevaluatingjavascriptfromstring: (NSString *) script;

Agreement:

@protocol uiwebviewdelegate <NSObject>

@optional

The method that is called when the content is ready to be loaded, and the settings that are loaded by the return value

-(BOOL) WebView: (UIWebView *) WebView shouldstartloadwithrequest: (nsurlrequest *) Request Navigationtype: ( Uiwebviewnavigationtype) Navigationtype;

method to invoke when loading starts

-(void) Webviewdidstartload: (UIWebView *) WebView;

method to invoke when loading is complete

-(void) Webviewdidfinishload: (UIWebView *) WebView;

Methods that are called when a load fails

-(void) WebView: (UIWebView *) WebView didfailloadwitherror: (nserror *) error;

@end

IOS: UIWebView of Page view controls

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.