Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6841963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:02:08+00:00 2026-05-27T00:02:08+00:00

Is it possible to do all of the above? SO has given me a

  • 0

Is it possible to do all of the above? SO has given me a great way to set the initial zoom scale here. Namely, to include the following line in my webViewDidFinishLoad method:

[webView stringByEvaluatingJavaScriptFromString: @"document.body.style.zoom = 5.0;"];

But what I still can’t do is allow the user to change the zoom scale after the program initially sets it. If I set scalePagesToFit to NO, the user can’t change the zoom scale. And if I set scalePagesToFit to YES, it overrides my programmatic zoom.

Can anyone help?

EDIT: thanks for the response. But if I zoom the scrollView, things blur a little.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:02:09+00:00Added an answer on May 27, 2026 at 12:02 am

    You can add or modify a <meta name='viewport' tag to achieve this. Apple documentation on the meta/viewport tag here:

    https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

    Here’s an example of adding the tag once the document is loaded:

    - (void) webViewDidFinishLoad:(UIWebView *)webView
    {
        NSString* js = 
        @"var meta = document.createElement('meta'); " \
         "meta.setAttribute( 'name', 'viewport' ); " \
         "meta.setAttribute( 'content', 'width = device-width, initial-scale = 5.0, user-scalable = yes' ); " \
         "document.getElementsByTagName('head')[0].appendChild(meta)";
    
        [webView stringByEvaluatingJavaScriptFromString: js];        
    }
    

    If the web page you’re loading provides an existing meta tag you may need to modify it rather than attempting to add a new meta element to the DOM. This SO question discusses the technique:

    Can I change the viewport meta tag in mobile safari on the fly?

    In my test app I set the UIWebView scalesPageToFit to YES.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this possible at all? The idea is to have the following: if ($some_statement)
Algorithm to generate all possible letter combinations of given string down to 2 letters
IS it at all possible to set the Google homepage to a file located
What all possible support is there from open source world for building web based
Possible Duplicate: Python code to pick out all possible combinations from a list? I
Is it at all possible to create a static/tv interference/twitch effect similar to what
Is this combination possible at all? If yes, will I still need to buy
I tried setting all possible styles to something other than grey, just to try
I am trying to display all possible values for a sub-property. Below I am
How can I enumerate all possible instances of System.Char ? I need to see

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.