Anthony Main
Anthony Main

Reputation: 6068

Have WebView zoomed by default

Is it possible to have a WebView zoomed in by default. Im trying to place and advert in my application and would like it to be zoomed to 100% by default so it fills the space.

Being able to disable zooming would also be a benefit but I cant disable all interaction as I would like them to be able to click the link

Upvotes: 0

Views: 1120

Answers (2)

Rog
Rog

Reputation: 17170

I have not tried this but, if you are in control of the HTML, make sure it is the correct size and use UIWebview's scalesPageToFit property. If not, you may be able to get hold of the HTML and massage it either on your sever or in your app before displaying it in the UIWebview

Upvotes: 2

Anthony Main
Anthony Main

Reputation: 6068

I didn't find out how to fix the zoom but I did manage to tweak my html banner code to force it to display the correct size using the following code in the head tag:

<meta name="viewport" content="width=320px,height=65px" />

Upvotes: 0

Related Questions