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 8197201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:41:35+00:00 2026-06-07T05:41:35+00:00

Is there a way to scale a web page in a UIWebView that maintains

  • 0

Is there a way to scale a web page in a UIWebView that maintains the aspect ratio but alleviates the need to scroll horizontally to read an article, for example. Vertical scrolling is fine, I just don’t want the user to have to constantly be scrolling back and forth horizontally to read each line of the article. Thanks!

Edit: the code I’m using to create the view

    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, [[self view] frame].size.width, [[self view] frame].size.height)];
    [_webView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
    [_webView setDelegate:self];
    [_webView setScalesPageToFit:YES];
    [_webView loadRequest:[NSURLRequest requestWithURL:[headline link]]];

The link is always formatted for mobile already.

  • 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-06-07T05:41:36+00:00Added an answer on June 7, 2026 at 5:41 am

    I think that defining the viewport for your UIWebView could help:

    <meta name="viewport" content="width=device-width"/>
    

    this is to use the full width of the device; if your UIWebView is smaller, that you can specify its width in points.

    In case you need to add the meta tag to the HTML of your page after loading it, you can use this code:

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

    Also check this S.O. thread for another technique for the same.

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

Sidebar

Related Questions

I need to build a web-scale public site that can handle, say, 100 queries/sec.
I have a simple web page that displays some text and images and trying
Is there a bare-bones Scala web framework? I basically need the essential features such
How to implement a web page that scales when the browser window is resized?
Is there a way to use the Heroku scheduler to start and stop web
is there a way in Scala to sort an array of tuples using and
Is there a standard way of invoking the scala REPL from a gradle task?
Is there a good scala-esque (I guess I mean functional) way of recursively listing
Is there way to get file from windows xp command prompt? I tried to
Is there way to automatically maximize the output window on hitting build and then

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.