Masking/scrolling views
I'm looking for the proper way to handle the following situation:
My view contains content, which is not as tall as the view itself and doesn't therefore require scrolling ever. In the lower part of the content is a textarea which will open the keyboard on focus and would be then completely covered by the keyboard. In this case I'd like to "scroll" the content up, until the textarea is again visible above the keyboard.
(Side question: I tried to use a scrollView but with this 'solution' I can't select the content anymore. Anyone know why?)
4 Answers
-
Accepted Answer
put your content and your textarea in another scrollview (called wrapper in this case). make this scrollview larger then the height of the stage. On your focus event for teh text area, set the scrollToView(); parameter to scroll the wrapper up so your text area will be above the keyboard.
-
Thanks! I'll will give that a try.
-
Thanks! I'll will give that a try.
-
That's odd. It should work where textfields cause a wrapping scrollview to scroll. See textfield_borders.js in Kitchen Sink for an example of this. If it still isn't working, do you have some sample code I could take a look at?