ciginfo Well-Known Member Licensed User Longtime User Jun 2, 2015 #1 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. Code: Copy ScrollView1.Panel.AddView(TxtEcran,10dip,0,100%x,2100dip) How to have the length of the scrollview1 according to the text size? Thank you
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. Code: Copy ScrollView1.Panel.AddView(TxtEcran,10dip,0,100%x,2100dip) How to have the length of the scrollview1 according to the text size? Thank you
klaus Expert Licensed User Longtime User Jun 2, 2015 #2 Try to set ScrollView1.ContentHeight = TxtEcran.Height Upvote 0
ciginfo Well-Known Member Licensed User Longtime User Jun 2, 2015 #3 No, "ScrollView1.ContentHeight = TxtEcran.Height" does not work Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jun 3, 2015 #4 Use CustomListView.AddText: https://www.b4x.com/android/forum/threads/class-customlistview.46560/#content Upvote 0
Use CustomListView.AddText: https://www.b4x.com/android/forum/threads/class-customlistview.46560/#content
ciginfo Well-Known Member Licensed User Longtime User Jun 4, 2015 #5 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 Scroll_lenght.zip 3.2 KB · Views: 483 Upvote 0
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
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2015 #6 This exact feature is implemented in CustomListView. Have you tried it? Upvote 0
ciginfo Well-Known Member Licensed User Longtime User Jun 5, 2015 #7 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
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.
narek adonts Well-Known Member Licensed User Longtime User Jun 5, 2015 #8 please find attached the working project. You main issue was that you were changing the text after making the size changes functions. Narek Attachments scrolltext.zip scrolltext.zip 3.3 KB · Views: 527 Upvote 0
please find attached the working project. You main issue was that you were changing the text after making the size changes functions. Narek
ciginfo Well-Known Member Licensed User Longtime User Jun 5, 2015 #9 Excellent! Finally the solution! Sure I changed the text size After making the size exchange functions. Big mistake. Thank you very much. Upvote 0
Excellent! Finally the solution! Sure I changed the text size After making the size exchange functions. Big mistake. Thank you very much.