简体   繁体   中英

adding content to webview?

I am writing an app in which there is a tab bar and it got 5 tabs, I placed UIWebView on top of that tabs using Interface Builder. Now I want to add some content (webpages) to that webview. Any help pls. Many Thanks.

UIWebView implements the following methods to load content:

  • -(void)loadRequest:(NSURLRequest *)request
  • -(void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
  • -(void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL

The first two are most straight-forward for remote and local content, respectively.

Have you read the UIWebView Class Reference ?

This will tell you everything you need to know and as per much of Apple's documentation, there's quite a few code samples attached so you can look at concrete implementations. (See the "Related sample code" section.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM