title: Xamarin forms: Layout visibility show/hide not working in iOS but working in Android
body: <p>I have a list containing two stack layout. Upon clicking the first stack in need to show/hide the second stack. This is working perfectly in android, but is not working in iOS. layout is not expanding when IsVisible is true. </p>
  
  <pre><code>  &lt;ListView ItemsSource="{Binding PackageList}"
                                ItemSelected="Package_ItemSelected"
                                IsPullToRefreshEnabled="true"
                                HasUnevenRows="True" 
                                SeparatorVisibility="None"&gt;
      &lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;ViewCell&gt;
                  &lt;Grid&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="60"/&gt;
                          &lt;RowDefinition Height="Auto"/&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;StackLayout Grid.Row="0" Padding="10" Orientation="Horizontal" Spacing="10" BackgroundColor="#f2f2f2"&gt;
                          &lt;Image Source="{Binding Item.PackageType}" VerticalOptions="CenterAndExpand"/&gt;
                          &lt;StackLayout Spacing="5" VerticalOptions="Center"&gt;
                              &lt;Label Text="{Binding Item.PackageName}" Style="{DynamicResource LabelStyle}" YAlign="Center"/&gt;
                              &lt;Label Text="(can accept/decline request only)" IsVisible="{Binding Item.PackageType}" Style="{DynamicResource LabelGraySmall}" LineBreakMode="WordWrap" YAlign="Center"/&gt;
                          &lt;/StackLayout&gt;
                          &lt;Grid HorizontalOptions="EndAndExpand" &gt;
                              &lt;Image Source="up.png" Style="{DynamicResource ArrowStyle}" IsVisible="{Binding IsVisible}" VerticalOptions="CenterAndExpand"/&gt;
                              &lt;Image Source="downsmall.png" Style="{DynamicResource ArrowStyle}" IsVisible="{Binding IsNotVisible}" VerticalOptions="CenterAndExpand"/&gt;
                          &lt;/Grid&gt;
                      &lt;/StackLayout&gt;
                      &lt;StackLayout Grid.Row="1" Padding="15" Spacing="10" IsVisible="{Binding IsVisible}"&gt;
                          &lt;StackLayout.GestureRecognizers&gt;
                              &lt;TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/&gt;
                          &lt;/StackLayout.GestureRecognizers&gt;
                          &lt;Label Text="{Binding Item.Description}" Style="{DynamicResource LabelStyle}" YAlign="Center" HorizontalTextAlignment="Center" HorizontalOptions="CenterAndExpand"/&gt;
                          &lt;Button Text="Choose Package" Command="{Binding Path=BindingContext.PackageCommand,Source={x:Reference packagePage}}" CommandParameter="{Binding Item}" Style="{DynamicResource ButtonBlue}" WidthRequest="200" HeightRequest="40" HorizontalOptions="CenterAndExpand" /&gt;
                      &lt;/StackLayout&gt;
                  &lt;/Grid&gt;
              &lt;/ViewCell&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>backend code</p>
  
  <pre><code>  private void Package_ItemSelected(object sender, SelectedItemChangedEventArgs e)
      {
  
              if (e.SelectedItem == null) return;
              if (e.SelectedItem != null)
              {
                  var tappedItem = (PackageWrapper&lt;PackageResult&gt;)e.SelectedItem;
                  tappedItem.IsNotVisible = !tappedItem.IsNotVisible;
                  tappedItem.IsVisible = !tappedItem.IsNotVisible;
              }
          ((ListView)sender).SelectedItem = null;
      }
  </code></pre>
  
  <p>Wrapper class:</p>
  
  <pre><code>    public class PackageWrapper&lt;T&gt; : INotifyPropertyChanged
  {
      public T Item { get; set; }
      bool isVisible =  false;
      public bool IsVisible
      {
          get
          {
              return isVisible;
          }
          set
          {
              if (isVisible != value)
              {
                  isVisible = value;
                  PropertyChanged(this, new PropertyChangedEventArgs("IsVisible"));
              }
          }
      }
      bool isNotVisible = true;
      public bool IsNotVisible
      {
          get
          {
              return isNotVisible;
          }
          set
          {
              if (isNotVisible != value)
              {
                  isNotVisible = value;
                  PropertyChanged(this, new PropertyChangedEventArgs("IsNotVisible"));
              }
          }
      }
      public event PropertyChangedEventHandler PropertyChanged = delegate { };
  }
  </code></pre>
  
  <p>Please refer the screenshot for details</p>
  
  <p><strong>Below is what i am getting in iOS</strong></p>
  
  <p><a href="https://i.stack.imgur.com/wInNe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wInNe.jpg" alt="Below is what i am getting in iOS"></a></p>
  
  <p><strong>Below is the expectation as in android.</strong>
  <a href="https://i.stack.imgur.com/qZfOU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qZfOU.png" alt="enter image description here"></a></p>