Android Question Match_Content

alon

Active Member
Licensed User
Longtime User
Hi,

I am trying to understand how things work when adding views on a panel .
I am creating a panel and I need to put a label with some text on it, and in the same line a button ,
Now the label width and height should be "match_content" meaning that the width and height should be according to text and font size in it.
The same is with the button.
So the question is what is the best way to do that.

Thanks.
 

alon

Active Member
Licensed User
Longtime User
Is the text single line or multiline?

You can create a label horizontally anchored to both sides and a button at the right side anchored to the right.

Thank ,

1. the text is multiline
2. what about the panel height, how it should be, in order to make its height acoording to the objects heights?
3. what if i have 3 object label1 lable2 and a button how should i anchored them
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use StringUtils.MeasureMultilineTextHeight to calculate the label's height.
Consider using CustomListView instead of ScrollView. It will probably be simpler.

what if i have 3 object label1 lable2 and a button how should i anchored them
Hard to say without seeing the desired layout.
 
Upvote 0
Top