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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:18:10+00:00 2026-05-13T14:18:10+00:00

I am using a UIWebView(loaded with a HTML file) and i want the offset

  • 0

I am using a UIWebView(loaded with a HTML file) and i want the offset of the scrolled position and the offset should remain constant if i change the text size.I want to store the previously scrolled position even if i change the text Size . HOw to do this????

  • 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-13T14:18:10+00:00Added an answer on May 13, 2026 at 2:18 pm

    I have another method which I found at http://www.alexnking.com/2008/10/14/going-back-to-the-last-place-you-were-in-a-uiwebview/, which might be of great help when you want to scroll a UIWebView manually.

    To get the current scroll position (vertical):

    [myWebView stringByEvaluatingJavaScriptFromString: @"scrollY"];
    
    // Application is terminating.
    
    - (void)applicationWillTerminate:(UIApplication *)application {
    
      [[NSUserDefaults standardUserDefaults] setInteger:
        [[myWebView stringByEvaluatingJavaScriptFromString: @"scrollY"]
          intValue] forKey: @"currentScroll"];
    }
    
    // Application is loading.
    
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    
     initialScrollPosition = [[NSUserDefaults standardUserDefaults]
                                    integerForKey: @"currentScroll"];
    }
    
    // WebView is finished loading
    
    - (void)webViewDidFinishLoad:(UIWebView *)webView {
    
      // Check if we need to scroll this somewhere.
    
      if (initialScrollPosition != 0) {
    
        // Scroll to the position.
    
        [passageView stringByEvaluatingJavaScriptFromString:
          [NSString stringWithFormat: @"window.scrollTo(0, %d);",
          self.initialScrollPosition]]; 
    
        // Set the initial scroll value to zero so we don't try
    
        // to scroll to it again if the user navigates to another page.
    
        self.initialScrollPosition = 0;
    
      }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using UIWebview to display a local html page. i tried this text<span><span/>text in
i am using couple of html pages which are loaded in UIWebView , there
I want to add padding on UIWebview using Javascript, because I switch the view
I have a piece of HTML which I am displaying inside a UIWebView using
i want to create the custom menu control in UIWebView, by using - (void)
I'm using UIWebView to play youtube videos on iPhone. When the video is loaded
Is there any way to display colorful text in iPhone without using UIWebView Eg
trouble loading html file from plist to webView using following code in FAQDetailViewController.m: -
I have a UIWebView with an HTML page completely loaded. The UIWebView has a
I'm displaying HTML content using a UIWebView and would like some action to occur

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.