I am using a dynamic Label that will only appear after I click a button above:
In a block where I call the content of Airtable, I set the Label text and then set its size to 0 so that it is hidden.
Outside this block of content, when I click the button I reset its size to -1 expecting it to show the text contained.
But nothing happens, even if in this block I pass a new text to the Label
How does height -1 work?
** What I need to do: ** I need to show or hide the Label when I click the button. I already thought about creating or deleting the Label instead of using its height as 0 to hide it, but outside my structure context where I have several For Each, one inside the other, I can’t. Another way would be to be able to somehow create or delete this Label right after the button, but I don’t know if this is possible after the dynamic structure is assembled.
First of all I have no idea that why App Inventor uses different constant values from android.The constant values defined/used in android are as follows: Fill Parent/Match Parent : -1 Wrap Content : -2
Now the constant values used in AI are as follows: Match Parent/Fill Parent : -2 Wrap Content : -1
In answer to your question: Fill Parent: it will take all available space Wrap Content: it will take only required space
In android documentation they are defined as follows: Fill Parent/Match Parent: Special value for the height or width requested by a View. MATCH_PARENT/FILL_PARENT means that the view wants to be as big as its parent, minus the parent’s padding, if any
Wrap Content: Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account.
If I set a fixed size, 100 for example, then the contents of the Label are shown.
Even when I create the Label, if I set its Height to -1, it just disappears.
So I remain restricted to the properties and methods existing in the native components.
Doesn’t that provide more customization options as you mentioned?
Thanks!