Tuesday, March 15, 2011

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

From stackoverflow
  • 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" />
    
  • 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

    Brijesh Patel : its great. i have also same problem. now its working. in my application zooming is not happen but after set the UIWebview's scalesPageToFit property set YES. now its working. now i can zooming and zoomout also.thanks.

0 comments:

Post a Comment