Android Question edittext box scrolls sooo slow. How to speed up?

scottie

Member
Licensed User
Longtime User
I have a simple textbox (edittext1.text) I add a few pages of text to it.
scrolling thru it is way to slow. How can I speed it up to scroll like when viewing a web page or something


Tried on my S4 and my Experia Z2 tablet. Same slowness


Thanks a bunch
-Scott
\
 
Last edited:

sorex

Expert
Licensed User
Longtime User
put the text box in a scrollview so that you move the textfield around and not the cursor in the text?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
Thanks for your help. I haven't had to play with scrollview yet. Looks like a lot of work. LoL

not really.

I think it's just adding a vertical scrollview, add a label to it and set the inner panel to the size of the label.

B4X:
Sub Globals
    Private ScrollView1 As ScrollView
    Dim mytext As Label
    Dim txt As String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
mytext.Initialize("")
ScrollView1.Panel.AddView(mytext,0,0,ScrollView1.Width,2000)
ScrollView1.Panel.Height=2000
txt="this is a very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong text"
mytext.Text=txt.Replace("o","o"&CRLF)
End Sub
 

Attachments

  • scroll label.zip
    7 KB · Views: 146
Upvote 0

sorex

Expert
Licensed User
Longtime User
just noticed you meant an editbox.

just change

B4X:
Dim mytext As Label

to

B4X:
Dim mytext As edittext

to have an editbox
 
Upvote 0

scottie

Member
Licensed User
Longtime User
That works. but still a lot of crap just to have normal scrolling? then I still have to determine how many lines
of text is in the string in order to make the panel long enough to show all the ( 902+/-) lines of text.

my code:
'ScrollView1.Width = EditText1.Width
'ScrollView1.Height = EditText1.Height
'ScrollView1.Left = EditText1.Left
'ScrollView1.Top = EditText1.Top
'mytext.Text=EditText1.Text
'ScrollView1.Panel.AddView(mytext,0,0,EditText1.Width,45000)
'ScrollView1.Panel.Height=45000

I have to put that "45000" in there to show all the lines. too high of a number and scrolling is slow again.
Too low of a number and all lines don't show.

Guess I have more learning to do. LoL


Thanks for your help sorex!
 
Upvote 0
Top