Android Question Find label's optimized height

klaus

Expert
Licensed User
You speak of Label and ScrollView heights.
You need to give more information on how many Labels in the ScrollView and how they are added.
Then there is a difference between ScrollView.Height and ScrollView.Panel.Height!
 

JohnC

Well-Known Member
Licensed User
Maybe you can use this code:

B4X:
    Dim SU As StringUtils
    Dim ItemHeight As Int = SU.MeasureMultilineTextHeight(MyLabel, MyLabel.Text)
To find out the required height for the label, then calculate the scrollview.panel.height based on that.
 
Top