I want to create a button and a container, such that each time I click the button the visibility of the container toggles between true (visible) and false (invisible).
I’ve learned how to wrap the container in a visibility wrapper, and to create a local variable for the visibility of the container.
I’ve learned how to create an icon button, and open the circuit diagram for its “on tap” event.
I can add to the circuit an if/then step.
But I can’t figure out how to test or set the visibility of the container within the circuit.
How can this be done?
on circuit add the logic to check if you variable for visibility
for example, let’s suppose your variable is like that: isVisible = false (default)
- Open circuit and add an if Statement
- Condition for the statement you put your variable which is already a boolean : isVisible
- if true, pick your variable and set it to false
- if false, pick your varialbe and set it to true
- add a refresh
it should work.
Gustavo: Thank you. Hopefully the screenshot, showing my circuit, will show up in this post.
In the Set settings, is using keys of “true” and “false” and turning on the Value switch the right way to set the value of the isVisible variable?
And in Refresh, I’m not sure what settings to make.
What do you think?
Hi Bill,
after your if Statement, select you local variable IsVisible. You will see just below the expression a button saying “set value”. correct the circuit and should work.
On the container, wrap with Visibility and in the expression put your local variable.
let me know if you need more info.
1 Like
Gustavo: I find Nowa a bit convoluted and strange, but by following your clues I was able to make it work. Thank you very much.
1 Like