iOS Question ScrollView and SizeToFit

ciginfo

Well-Known Member
Licensed User
Longtime User
Hello,
I have a page with a Scrollview1 buit with designer, 100%x, 100%y.
I add with code a texfield into the Scrollview.
I have to put text into the texfield with variable length.
I would like to adapt the text height and scrollview depending on the size.
I easily adapt the height of textfield with SizeToFit function but height of the scrollview remains often too long.
B4X:
ScrollView1.Panel.AddView(TxtEcran,10dip,0,100%x,2100dip)
How to have the length of the scrollview1 according to the text size?
Thank you
 

ciginfo

Well-Known Member
Licensed User
Longtime User
Unable to solve my problem, I need help.
A small program attached file. In this program how to adapt the height of the TextView and height of scrollview to the length of the text put in the textview?
If anyone can watch and help me.
thank you a lot
 

Attachments

  • Scroll_lenght.zip
    3.2 KB · Views: 281
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
No I have not tried because I have not very well understood. Have I to replace TxtEcran by CustomListView or replace all ScrollView by CustomListView and rebuilt my page inside, which is more complicate.
 
Upvote 0

narek adonts

Well-Known Member
Licensed User
Longtime User
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
Excellent! Finally the solution! Sure I changed the text size After making the size exchange functions. Big mistake.
Thank you very much.
 
Upvote 0
Top