Giusy Active Member Licensed User Feb 26, 2019 #1 Hi, this is my code: B4X: scvImages.panel.AddView(lb1, 0,0,BWidth,BHeight) scvImages.Panel.Height=??? Lb1 contains variable-length text (including chr (10) and chr (13)) How can I calculate the length to be applied in panel.height? Thanks
Hi, this is my code: B4X: scvImages.panel.AddView(lb1, 0,0,BWidth,BHeight) scvImages.Panel.Height=??? Lb1 contains variable-length text (including chr (10) and chr (13)) How can I calculate the length to be applied in panel.height? Thanks
Jeffrey Cameron Well-Known Member Licensed User Longtime User Feb 26, 2019 #2 You can use string utils measuremulilinetextheight: https://www.b4x.com/android/help/stringutils.html#stringutils_measuremultilinetextheight @Erel also has a good example of an auto-size label class, which you could take a look at. Upvote 0
You can use string utils measuremulilinetextheight: https://www.b4x.com/android/help/stringutils.html#stringutils_measuremultilinetextheight @Erel also has a good example of an auto-size label class, which you could take a look at.
Brandsum Well-Known Member Licensed User Feb 27, 2019 #4 Giusy said: Hi, this is my code: B4X: scvImages.panel.AddView(lb1, 0,0,BWidth,BHeight) scvImages.Panel.Height=??? Lb1 contains variable-length text (including chr (10) and chr (13)) How can I calculate the length to be applied in panel.height? Thanks Click to expand... I would recommend using xCustomListView, AddTextItem will automatically adjust the height based on the text. Though you can use StringUtils as @Jeffrey Cameron said. Upvote 0
Giusy said: Hi, this is my code: B4X: scvImages.panel.AddView(lb1, 0,0,BWidth,BHeight) scvImages.Panel.Height=??? Lb1 contains variable-length text (including chr (10) and chr (13)) How can I calculate the length to be applied in panel.height? Thanks Click to expand... I would recommend using xCustomListView, AddTextItem will automatically adjust the height based on the text. Though you can use StringUtils as @Jeffrey Cameron said.