开发者

iphone webview doubts

开发者 https://www.devze.com 2023-02-21 11:51 出处:网络
I was wondering, how can I use 开发者_StackOverflow中文版1 UIWebView controller to open multiple URLs.

I was wondering, how can I use 开发者_StackOverflow中文版1 UIWebView controller to open multiple URLs. I have 5 buttons, and each button should open different website, so I want to know how to use one XIB with UIWebView to open different URL everytime and not use 5 UIWebView and 5 XIBs.


This is quite simple. Do the following:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.stackoverflow.com"]]];

EDIT: If you need to load multiple images, you need to write HTML to handle that. Once you've figured out how to write the HTML you use the following method:

[webView loadHTMLString:htmlString baseURL:baseURL];


Write an HTML code. Place 5 image tag. Fill each imgsrc with each url and load the html string. Better get the support of a web developer to write the html code.

0

精彩评论

暂无评论...
验证码 换一张
取 消