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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:39:32+00:00 2026-06-01T13:39:32+00:00

This is the view that appears when I click a button on a previous

  • 0

This is the view that appears when I click a button on a previous view.
The text boxes, the smiling face image and the labels are predesigned created by xCode.

Please see the image and the code of the view to clear why all the view’s components are initializing very slowly and getting ready to give the last shoot that is captured by me when it is finished to be totally loaded . Moreover, It is very slow when I type letters, the letters are appearing very slowly while I am typing with the keyboard that iOS provides on every touch on the text box.

enter image description here

The Code of The View;

using System;
using System.Drawing;

using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace IstanbulCity
{
    public partial class AskForNAme : UIViewController
    {
        public delegate void AskForNAmeClosingDelegate (AskForNAme form);

        public event AskForNAmeClosingDelegate AskForNAmeClosed;
        NSObject obs1;
        float scrollamount = 0.0f;
        float bottomPoint = 0.0f;
        float yOffset = 0.2f;
        bool moveViewUp = false;

        public AskForNAme () : base ("AskForNAme", null)
        {


        }

        public override void DidReceiveMemoryWarning ()
        {
            // Releases the view if it doesn't have a superview.
            base.DidReceiveMemoryWarning ();

            // Release any cached data, images, etc that aren't in use.
        }

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();


            // Perform any additional setup after loading the view, typically from a nib.
        }
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(true);
                obs1 = NSNotificationCenter.DefaultCenter.AddObserver (
"UIKeyboardDidShowNotification", KeyboardUpNotification);
            this.tbOwnerMailAdress.ShouldReturn += TextFieldShouldReturn;
            this.tbOwnerBirthDay.ShouldReturn += TextFieldShouldReturn;
            this.uivGuguPhoto.Image = UIImage.FromFile ("image/fcuk.jpeg");

        }
        public override void ViewWillAppear(bool animated)
        {  
            base.ViewWillAppear(false);
            obs1 = NSNotificationCenter.DefaultCenter.AddObserver (
"UIKeyboardDidShowNotification", KeyboardUpNotification);
            this.tbOwnerMailAdress.ShouldReturn += TextFieldShouldReturn;
            this.tbOwnerBirthDay.ShouldReturn += TextFieldShouldReturn;
            this.uivGuguPhoto.Image = UIImage.FromFile ("image/fcuk.jpeg");

        }
        public override void ViewDidUnload ()
        {
            base.ViewDidUnload ();

            // Clear any references to subviews of the main view in order to
            // allow the Garbage Collector to collect them sooner.
            //
            // e.g. myOutlet.Dispose (); myOutlet = null;

            ReleaseDesignerOutlets ();
        }

        public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
        {
            // Return true for supported orientations
            return (toInterfaceOrientation != UIInterfaceOrientation.PortraitUpsideDown);
        }

        void HandleIstanbulCityViewControllerClosed (babyAge form)
        {
            form.DismissModalViewControllerAnimated (true);
            form = null;
        }



        partial void tbKadikoyHallEditDidEndOnExit (MonoTouch.Foundation.NSObject sender)
        {
            tbIstanbulName.ResignFirstResponder ();
        }



        private bool TextFieldShouldReturn (UITextField tf)
        {
            tf.ResignFirstResponder ();
            if (moveViewUp) {
                ScrollTheView (false);
            }
            return true;
        }

        private void KeyboardUpNotification (NSNotification notification)
        {
            ResetTheView ();

            RectangleF r = UIKeyboard.BoundsFromNotification (notification);

            if (this.tbOwnerMailAdress.IsEditing ) {
                //Calculate the bottom of the Texbox
                //plus a small margin...
                bottomPoint = (this.tbOwnerMailAdress.Frame.Y + this.tbOwnerMailAdress.Frame.Height + yOffset);

                //Calculate the amount to scroll the view
                //upwards so the Textbox becomes visible...
                //This is the height of the Keyboard -
                //(the height of the display - the bottom
                //of the Texbox)... 
                scrollamount = (r.Height - (View.Frame.Size.Height - bottomPoint));
            }
            else if (this.tbOwnerBirthDay.IsEditing)
            {
                bottomPoint = (this.tbOwnerBirthDay.Frame.Y + this.tbOwnerBirthDay.Frame.Height + yOffset);
                scrollamount = (r.Height - (View.Frame.Size.Height - bottomPoint));
            }
            else
            {
                scrollamount = 0;
            }

            //Check to see whether the view
            //should be moved up...
            if (scrollamount > 0) {
                moveViewUp = true;
                ScrollTheView (moveViewUp);
            }  else
                moveViewUp = false;
        }

        private void ResetTheView ()
        {
            UIView.BeginAnimations (string.Empty, System.IntPtr.Zero);
            UIView.SetAnimationDuration (0.3);

            RectangleF frame = View.Frame;
            frame.Y = 0;
            View.Frame = frame;
            UIView.CommitAnimations ();
        }

        private void ScrollTheView (bool movedUp)
        {
//To invoke a views built-in animation behaviour,
//you create an animation block and
//set the duration of the move...
//Set the display scroll animation and duration...
            UIView.BeginAnimations (string.Empty, System.IntPtr.Zero);
            UIView.SetAnimationDuration (0.3);

//Get Display size...
            RectangleF frame = View.Frame;

            if (movedUp) {
//If the view should be moved up,
//subtract the keyboard height from the display...
                frame.Y -= scrollamount;
            }  else {
//If the view shouldn't be moved up, restore it
//by adding the keyboard height back to the original...
                frame.Y += scrollamount;
            }

//Assign the new frame to the view...
            View.Frame = frame;

//Tell the view that your all done with setting
//the animation parameters, and it should
//start the animation...
            UIView.CommitAnimations ();

        }
    }
}

The Recent Version – Still The Same User Experience’ slow!

using System;
using System.Drawing;

using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace IstanbulCity
{
    public partial class AskForNAme : UIViewController
    {
        public delegate void AskForNAmeClosingDelegate (AskForNAme form);

        public event AskForNAmeClosingDelegate AskForNAmeClosed;


        public AskForNAme () : base ("AskForNAme", null)
        {


        }

        public override void DidReceiveMemoryWarning ()
        {
            // Releases the view if it doesn't have a superview.
            base.DidReceiveMemoryWarning ();

            // Release any cached data, images, etc that aren't in use.
        }

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();


            // Perform any additional setup after loading the view, typically from a nib.
        }


        public override void ViewDidUnload ()
        {
            base.ViewDidUnload ();

            // Clear any references to subviews of the main view in order to
            // allow the Garbage Collector to collect them sooner.
            //
            // e.g. myOutlet.Dispose (); myOutlet = null;

            ReleaseDesignerOutlets ();
        }

        public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
        {
            // Return true for supported orientations
            return (toInterfaceOrientation != UIInterfaceOrientation.PortraitUpsideDown);
        }

        void HandleIstanbulCityViewControllerClosed (babyAge form)
        {
            form.DismissModalViewControllerAnimated (true);
            form = null;
        }







    }
}
  • 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-01T13:39:34+00:00Added an answer on June 1, 2026 at 1:39 pm

    This does not look to be initialization related. You are adding notifications from both ViewDidAppear and ViewWillAppear. You’re also always calling ResetTheView, which does animations, on every keyboard notification (even if nothing else changed).

    My guess is that you are calling ResetTheView way more often that you realize – and the continuous animations are killing the performance of your application.

    You can confirm this by putting a Console.WriteLine, and maybe a counter, in the ResetTheView method.

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

Sidebar

Related Questions

I got a view that inherits : System.Web.Mvc.ViewPage<IEnumerable<MyProjects.Models.MyAccountWrapper>> In this view I list data
I use this tab view that developed base on jQuery: https://d2o0t5hpnwv4c1.cloudfront.net/001_Tabbed/site/jQuery.html# I change the
I want to execute this script (view source) that uses Google Translate AJAX API
I have a hypothetical tree view that contains this data: RootNode Leaf vein SecondRoot
I have a View that renders something like this: Item 1 and Item 2
I know this is extremely silly. I have a view controller that scans a
https://search.twitter.com/search.json?q=doug How do I read this like VIEW SOURCE, so that I know what
I have a view user control that can post form. This control can be
The offending command that msi executes is: .\devenv.com /command View.Toolbox /setup This fails with
I can't find any documentation to confirm this, but it appears that you can

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.