I have layout where i am trying to hide and show 2 buttons on click of down arrow button which is in expandable list which is creating fluctuation in 2 buttons.
Tried reducing height of those 2 buttons initially and then give some height dynamically.
<Button x:Name="completebtn" IsVisible="{Binding TaskStatus}"
AutomationId="btnComplete"
Command="{Binding BindingContext.CompleteOptionClickedCommand,
Source={x:Reference taskList}}" CommandParameter="{Binding .}"
Style="{StaticResource darkBlueButton}"
Text="Complete"
HeightRequest="50"
WidthRequest="120"></Button>
Actual behavior is when i expand and collapse any list item the two buttons within the list item should not fluctuate until and unless i click on down arrow button.
To hide and show a View in Xamarin Forms you use the IsVisible
property which accepts a boolean and is by default set to true.
You can use it like this:
<Button x:Name="MyButton"...... IsVisible="false"/>
Then In your code, you can set it back to visible, as follows:
MyButton.IsVisible=true;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.