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

Discussion in 'Android Questions' started by scottie, May 20, 2015.

  1. scottie

    scottie New Member Licensed 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: May 20, 2015
  2. sorex

    sorex Expert Licensed User

    put the text box in a scrollview so that you move the textfield around and not the cursor in the text?
     
    scottie likes this.
  3. scottie

    scottie New Member Licensed User

    Thanks for your help. I haven't had to play with scrollview yet. Looks like a lot of work. LoL
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can use CustomListView.AddText to do exactly what you need.
     
  5. sorex

    sorex Expert Licensed User

    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.

    Code:
    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
     

    Attached Files:

  6. sorex

    sorex Expert Licensed User

    just noticed you meant an editbox.

    just change

    Code:
    Dim mytext As Label
    to

    Code:
    Dim mytext As edittext
    to have an editbox
     
  7. scottie

    scottie New Member Licensed 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!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice