开发者

Help Needed in web view

HI All,

I am using web view to open a web page in my iphone app, its woking well, and able to connect to the mentioned web page, but in the web page v开发者_开发技巧iew it shows crossed images instead of the actual images there, and look is also not so good, is there any way to rectify this.

With Thanks iPhoneDeveloper11


Yes, there's many ways to improve the view of your web page. This is basically how I'm doing this:

  1. First you need to download the webpage. I use ASIHTTPRequest for this purpose.
  2. Analyze the response you receive. Print a string from the response:

    NSString * response = [request responseString];

    NSLog(@"HTML code: %@", response);

  3. Scan and replace the html code by use of NSScanner. Example code:

    • Parsing CSV Data
    • Writing a parser using NSScanner

The crossed image could be an image tag which does not contain a valid url. You can use NSScanner to find the image tag and correct the url, or if you want to you can resize or align the image. Learn about simple image tags on this link: Simple Image HTML Tags.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜