×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    270

    How to set textarea scroll on top when we scroll it till the end

    I m working on s40 app and using lwuit 1.5 teatarea. I keep on changing text in textarea using pointer dragged and released methods but when i scroll down my text area and then swipe i got my text changed in middle of scroll. I want to show it from top each time text changes in textarea.

    Second problem i m facing is i need to display 3-4 lines in a form so i m taking textarea(since 1-2 lines can increase depending on text) for it and made it setuiid("Label") . It is getting scrolled which i dont want . I is not supposed to scroll.

    Plz help
    Last edited by Manpreet_Singh; 2013-11-29 at 03:53.

  2. #2
    Registered User
    Join Date
    May 2013
    Posts
    270

    Re: How to set textarea scroll on top when we scroll it till the end

    anyone??.........

  3. #3
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: How to set textarea scroll on top when we scroll it till the end

    This is the disadvantage of the approach you have taken.Since while you are scrolling, pointer dragged and released methods will be called.You could try figuring out if the scroll is from left to right or viceversa and try modifying your code appropriately

    Another way of dealing with this could be by following the link given below.There is an implementation of swipe for images, that you could probably use for text area.Instead of swiping to a next image, you will be swiping to another text area or you could try changing the contents of the text area.You

    http://lwuit.blogspot.in/2010/07/swipe-that-image.html

    A third method would be use tabs.Tabs support swipe naturally.You can remove the top portion of the tabs, hence it wont appear like you are using tabs.You can probably try adding tabs dynamically as you swipe.

  4. #4
    Registered User
    Join Date
    May 2013
    Posts
    270

    Re: How to set textarea scroll on top when we scroll it till the end

    Actually my code is doing pretty fine using pressed and released . I am using it as replacement of swipe gestures. Yes even on scrolling it is showing pressed and released but how to get on top of textarea again when i change text since i want scroll should always be from top ? Just a rough idea how i should start (Since i have implemented whole logic using pressed and released methods)

    I am sending vedio of problem i am facing. my textarea is not scrolling from top when i swipe .. here it is http://videobam.com/jHBJW

    plz help
    Last edited by Manpreet_Singh; 2013-12-02 at 05:50.

  5. #5
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: How to set textarea scroll on top when we scroll it till the end

    Hi

    Try using this : ta.scrollRectToVisible(0, 0, -ta.getWidth(), -ta.getHeight(), ta.getParent());

    where ta is your text area object

  6. #6
    Registered User
    Join Date
    May 2013
    Posts
    270

    Re: How to set textarea scroll on top when we scroll it till the end

    thnks arun it worked

Similar Threads

  1. please help,how to scroll textArea in s40-with-theme
    By vikranttanwar@ in forum Mobile Java UI and User Experience
    Replies: 13
    Last Post: 2013-10-25, 15:34
  2. Lwuit how to make textarea scroll by page
    By Youssef77 in forum Mobile Java UI and User Experience
    Replies: 4
    Last Post: 2013-08-31, 16:39
  3. how to scroll the textarea of lwuit in S40_with_theme
    By vikranttanwar@ in forum Mobile Java UI and User Experience
    Replies: 7
    Last Post: 2013-08-29, 07:44
  4. TextArea won't scroll
    By KimF in forum Nokia N9
    Replies: 1
    Last Post: 2012-01-08, 05:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •