Xamarin Forms IsVisible mistakenly takes place

I have a list view with a template switcher, and for a specific item I want it to be hidden, so I used a hidden template. I set view (or StackLayout) as isVisible = false and HeightRequest = 0 so that it does not take up space and should not be visible. However, as you can see in the picture, it still occupies an empty space.

There are 2 hidden messages in the image below. Before "This is a message with a bot-hero!" and one after him.

How do you do this so you don’t take up space?

enter image description here

+4
source share
1 answer

, Grid . . https://forums.xamarin.com/discussion/83632/hiding-and-showing-stacklayout

<ListView x:Name="ItemList" HasUnevenRows="True">

          <ListView.ItemTemplate>
            <DataTemplate>
              <ViewCell  Appearing="Cell_OnAppearing" Tapped="ViewCell_Tapped" >
                <ViewCell.View>
             <Grid.RowDefinitions>
                <RowDefinition Height="100"/>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

          </ViewCell.View>
              </ViewCell>
            </DataTemplate>

          </ListView.ItemTemplate>

        </ListView>

0

Source: https://habr.com/ru/post/1659789/


All Articles