HonkyHonk
HonkyHonk

Reputation: 86

How to zoom content in UIWebView when content is scaled for (iphone)-width

A lot of webpages today, have meta tags or CSS styles, which defines the content width to 320px. When you load one of these pages in an UIWebView it is not possible to pinch-to-zoom. (You can try it in the Safari-browser on the iPhone).

As a visual impaired person, I find that very annoying.

Is there anyway to enable pinch-to-zoom for these kind of pages? Can I in anyway remove those tags/styles?

Can I in some way manually code some mechanism in an UIWebView, which could emulate this functionality?

Any help would be appreciated.

Thank you.

Upvotes: 1

Views: 525

Answers (1)

Michael Frederick
Michael Frederick

Reputation: 16714

You could load the HTML file that you are going to display in your UIWebView into an NSString, then use a regex to remove the viewport meta tag (which is what I believe disables the zooming), and then load the new NSString into the UIWebView.

Upvotes: 1

Related Questions