TomA Active Member Licensed User Longtime User Jan 12, 2013 #1 I am trying to develop a text based app that needs vertically scrolled text where the last line(s) added should display (basically, always scroll to the bottom). Using the method in the LongTextSimple example to do the scrolling (a label inside the scrollview), everything is fine until the keyboard opens. Although everything seems to be resized properly (i.e. the scrollview adjusts to the correct length), the text does not seem to scroll to the end, although it can be manually scrolled to that position. When the keyboard closes, everything is OK again. I stripped to code down to work on the problem and have attached the app here so you can check it out. Any help would be appreciated to make this work as intended. Attachments ScrollProblem.zip ScrollProblem.zip 8.8 KB · Views: 306
I am trying to develop a text based app that needs vertically scrolled text where the last line(s) added should display (basically, always scroll to the bottom). Using the method in the LongTextSimple example to do the scrolling (a label inside the scrollview), everything is fine until the keyboard opens. Although everything seems to be resized properly (i.e. the scrollview adjusts to the correct length), the text does not seem to scroll to the end, although it can be manually scrolled to that position. When the keyboard closes, everything is OK again. I stripped to code down to work on the problem and have attached the app here so you can check it out. Any help would be appreciated to make this work as intended.
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2013 #2 Use CallSubDelayed: Code: Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int) My100Y = NewHeight ScrollView1.Height = My100Y - 50dip ' Reset scrollview height CallSubDelayed(Me, "Scroll") End Sub Sub Scroll ScrollView1.FullScroll(True) End Sub Upvote 0
Use CallSubDelayed: Code: Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int) My100Y = NewHeight ScrollView1.Height = My100Y - 50dip ' Reset scrollview height CallSubDelayed(Me, "Scroll") End Sub Sub Scroll ScrollView1.FullScroll(True) End Sub
TomA Active Member Licensed User Longtime User Jan 13, 2013 #3 Works great!! Now I can get back to developing the program. Thank-you. Upvote 0