I am having an issue with Edit Text height not the same as Scroll View Panel height. I am using the string Utility to measure the height of the Edit Text and setting the height on both Edit Text and Scroll View.Panel. The Scroll View Panel is somehow larger?
Any help will be appreciated.
Any help will be appreciated.
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
'Private imgDiag As BetterImageView
Private etText As EditText
Private svScroll As ScrollView
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("1")
svScroll.Initialize(1dip)
Activity.AddView(svScroll, 0, 0, 100%x, 50%y)
etText.Initialize("")
svScroll.Panel.AddView(etText, 0, 0, 100%x, 50%y)
'etText.InputType = etText.INPUT_TYPE_NONE
etText.SingleLine = False
etText.Wrap = False
For x = 0 To 50
etText.Text = etText.Text & "testing " & x & " xxxxxxxxxxxxx...............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" & Chr(10)
Next
Dim su As StringUtils
Dim edheight As Int = su.MeasureMultilineTextHeight(etText, etText.Text)
'Log(edheight)
svScroll.Panel.Height = (edheight/3) + 20dip
etText.Height = svScroll.Panel.Height
End Sub