Answered by:
How to resize screen when keyboard is shown

Question
-
Hello,
I have a screen which has a textblock on top, a scrollview in the middle and a textbox at the bottom.
When you focus the textbox, the virtual keyboard is shown. Because of that, the whole screen is shifted upwards. Now the top half of the screen isn't visible anymore.But what I want, is that the screen is resized in such a way that all three controls are still visable, by resizing the scrollview.
Is there a way to do this?
Wednesday, September 26, 2012 8:46 AM
Answers
-
The user experience on WP7 is designed so that whole page is moved up so that the focussed TextBox appears just above the keyboard popup. This should not be an issue if you are using single line TextBox. If you are using a multi-line TextBox, then you should enclose it in a ScrollViewer.
Resizing the TextBox is not a good practice. And you can't get the height of the keyboard.
ThanQ...
- Proposed as answer by Dave Hunt (ProfEclipse)Banned Thursday, September 27, 2012 7:38 PM
- Marked as answer by Matt SmallMicrosoft employee Friday, February 8, 2013 9:01 PM
Thursday, September 27, 2012 1:49 PM
All replies
-
sure is!
The textbox has a gotFocus event and a lostFocus event. Since we know that the keyboard will appear as long as the textbox has focus, we just need to a line that adjusts the height on gotFocus, and un-adjusts the height on lostFocus.
Thursday, September 27, 2012 3:34 AM -
Yes i saw those events, but how do I get the height of the keyboard that is shown?
That height is different depending on the screen orientation, and i assume it can be different depending on which phone you are using.Thursday, September 27, 2012 12:40 PM -
The user experience on WP7 is designed so that whole page is moved up so that the focussed TextBox appears just above the keyboard popup. This should not be an issue if you are using single line TextBox. If you are using a multi-line TextBox, then you should enclose it in a ScrollViewer.
Resizing the TextBox is not a good practice. And you can't get the height of the keyboard.
ThanQ...
- Proposed as answer by Dave Hunt (ProfEclipse)Banned Thursday, September 27, 2012 7:38 PM
- Marked as answer by Matt SmallMicrosoft employee Friday, February 8, 2013 9:01 PM
Thursday, September 27, 2012 1:49 PM