true if the element should be rendered; otherwise, false. Default value is true.
Setting IsVisible to false will remove the element from the visual tree. The element will no longer take up space in layouts or be eligle to receive any kind of input event.
The following example shows a stack where the middle element is toggled when a button is activated.
C# Example
partial class LabelToggle {
Label label;
void Build ()
{
var firstView = new Button {Text = "Tap Me"};
label = new Label {Text = "I can be toggled"};
var thirdView = new Image {Source = "image.png"};
firstView.Activated += OnButtonActivated;
Content = new StackLayout {
Children {
firstView,
label,
thirdView
}
};
}
void OnButtonActivated (object sender, EventArgs args)
{
label.IsVisible = !label.IsVisible;
}
}