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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:36:10+00:00 2026-06-01T19:36:10+00:00

I have an application working on the following envirnoment: Monotouch 2.1 MonoDevelop 2.4.2 MacOS

  • 0

I have an application working on the following envirnoment:

  • Monotouch 2.1
  • MonoDevelop 2.4.2
  • MacOS 10.6.8
  • iOS SDK 4.3

The same application, migrated to iOS 5.0/5.1 and Monotouch 5.2.10 with MonoDevelop 2.8.8.4 under, has the following problem: When i click a button to navigate in a UIWebView do not work.

Code is that:(obviously it’s same in Monotouch 2.1)

public void ScrollToTop (object sender, EventArgs evt)
{
    webView.EvaluateJavascript("window.scrollTo(0,0)");
}

What could i do?

SOLVED (with Jonathan.Peppers help):

public void ScrollToTop (object sender, EventArgs evt)
{
    if((UIDevice.CurrentDevice.CheckVersion(5, 0)){                 
                System.Drawing.PointF p = new System.Drawing.PointF(0, 0);
                webView.ScrollView.SetContentOffset(p,true);
            }
            else{
                webView.EvaluateJavascript("window.scrollTo(0,0)");                 
            }
}

i have made in that way because on 4.3 webView.ScrollView.SetContentOffset make application crash.

  • 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-01T19:36:11+00:00Added an answer on June 1, 2026 at 7:36 pm

    Try this:

    string error = webView.EvaluateJavascript("try { window.scrollTo(0,0); } catch (e) { return e.message; }");
    

    (double check my code)

    It should get you a better error message. Tell us the value of the string returned.

    I suspect the issue isn’t MonoTouch, but perhaps iOS5? Safari had drastic changes in iOS5, new javascript engine, etc.

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

Sidebar

Related Questions

i have a strange problem. I have an ICEFaces(1.8.2) + Facelets application im working
I have recently started working on a legacy application that has most of its
I have a working application using python and zeromq and I would like to
I have an application that is working as a proxy using QTcpSocket to intercept
Now that I have a read-only application working, I am working on the insert
I have an application I have been working on and it can be slow
I have an application in Access 2003 that I am working on. In it,
i have used progress bar in my application..my application is working fine but the
I have web application Project having RPC call. one RPC async is working fine.
I'm building a WPF application and working with the MVVM pattern. I have 4

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.