Forum Xamarin Xamarin.iOS

Reduce view controller size when keyboard comes out

blackidblackid INMember

I am sure this must have been answered earlier. Tried searching a lot but I guess I couldn't find it. So here is the question. I have a form on one of my app. I have 3 text fields. Now when I try entering the text on the first field, the other two get overlapped by the keyboard. How do I make the view smaller when the keyboard comes out and make it scrollable and when it goes out, the view should resize to normal again? How can this be achieved?

Thanks for the help in advance!



  • blackidblackid INMember

    Okay, so this is what I did. I added a new view controller file. To that I added a view. To the view, I added a sub view which is a uiscrollview. To the UI Scrollview, I added 3 text boxes, txt1, txt2 and txt3. These are evenly spaced as under...

    Now, I added the following code in the cs file (see attachment)...

    The problem is, the scroll view won't scroll... The view becomes smaller, but doesn't start scrolling... what should i Do?

    Please advise!



  • softlionsoftlion FRBeta ✭✭✭

    You should reduce the height of your scrollview when the keyboard pops. It pops over the view.

  • softlionsoftlion FRBeta ✭✭✭

    Search in stackoverflow, this is a classic problem.

  • blackidblackid INMember

    yepp... Got it solved... actually didn't do anything! It just started working!

Sign In or Register to comment.