Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.

Illustration of the problem

(Side question: I tried to use a scrollView but with this 'solution' I can't select the content anymore. Anyone know why?)

— asked March 23rd 2010 by Florian Plank
  • masking
  • scrolling
  • scrollview
  • view
0 Comments

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.

    — answered March 23rd 2010 by Glenn Tillemans
    permalink
    0 Comments
  • Thanks! I'll will give that a try.

    — answered March 23rd 2010 by Florian Plank
    permalink
    0 Comments
  • Thanks! I'll will give that a try.

    — answered March 23rd 2010 by Florian Plank
    permalink
    0 Comments
  • 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?

    — answered March 23rd 2010 by Blain Hamon
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.