title: Nested CollectionViews and display (with Visual Studio 2019, Xamarin XPlatform Android)
body: <ol>
  <li>Nested CollectionView with scrolling one inside another: is it officially supported?</li>
  <li>Display these collections problem</li>
  </ol>
  <p>See below my data model and the XAML code (I have no site to put the resulting screen image in)</p>
  <pre class="lang-cs prettyprint-override"><code>namespace Notes.Models
  {
      public class Note
      {
          public enum NoteStatus { suspended, alive }
  
          public string       Description { get; set; }
          public NoteStatus   Status { get; set; }
      }
  
      public class NotesContainer
      {
          public string                       Name { get; set; }
          public DateTime                     LastModified { get; set; }
          public ObservableCollection&lt;Note&gt;   ListOfNotes { get; set; }
      }
  }
  </code></pre>
  <pre class="lang-xml prettyprint-override"><code>  &lt;CollectionView x:Name=&quot;notesContainers&quot; SelectionMode=&quot;Single&quot; EmptyView=&quot;No items currently exist !&quot;&gt;
      &lt;CollectionView.ItemTemplate&gt;
        &lt;DataTemplate&gt;
          &lt;Frame BorderColor=&quot;Red&quot; BackgroundColor=&quot;Beige&quot; CornerRadius=&quot;3&quot; HasShadow=&quot;False&quot; Padding=&quot;5&quot;&gt;
            &lt;StackLayout BackgroundColor=&quot;Aqua&quot; Padding=&quot;5&quot;&gt;
              &lt;Grid&gt;
                &lt;Grid.RowDefinitions&gt;&lt;RowDefinition Height=&quot;auto&quot;/&gt;&lt;RowDefinition Height=&quot;auto&quot;/&gt;&lt;/Grid.RowDefinitions&gt;
                &lt;Grid.ColumnDefinitions&gt;&lt;ColumnDefinition/&gt;&lt;ColumnDefinition/&gt;&lt;/Grid.ColumnDefinitions&gt;
                &lt;Label Grid.RowSpan=&quot;2&quot; Text=&quot;{Binding Name}&quot; VerticalTextAlignment=&quot;Center&quot; FontSize=&quot;Large&quot;/&gt;
                &lt;Label Grid.Row=&quot;0&quot; Grid.Column=&quot;1&quot; Text=&quot;{Binding LastModified, StringFormat='\{0:dddd dd}'}&quot; HorizontalTextAlignment=&quot;End&quot;/&gt;
                &lt;Label Grid.Row=&quot;1&quot; Grid.Column=&quot;1&quot; Text=&quot;{Binding LastModified, StringFormat='\{0:MMMM yyyy}'}&quot; HorizontalTextAlignment=&quot;End&quot;/&gt;
              &lt;/Grid&gt;
              &lt;StackLayout BackgroundColor=&quot;BlueViolet&quot; Padding=&quot;10&quot;&gt;
                &lt;CollectionView ItemsSource=&quot;{Binding ListOfNotes}&quot; SelectionMode=&quot;Single&quot; EmptyView=&quot;No items currently exist !&quot;&gt;
                  &lt;CollectionView.ItemTemplate&gt;
                    &lt;DataTemplate&gt;
              &lt;StackLayout BackgroundColor=&quot;Coral&quot; Padding=&quot;0,3&quot;&gt;
                      &lt;Frame BorderColor=&quot;Blue&quot; BackgroundColor=&quot;LightBlue&quot; CornerRadius=&quot;3&quot; HasShadow=&quot;False&quot; Padding=&quot;5&quot;&gt;
                        &lt;StackLayout Orientation=&quot;Horizontal&quot;&gt;
                          &lt;Label Text=&quot;{Binding Description}&quot; HorizontalOptions=&quot;Start&quot; VerticalTextAlignment=&quot;Center&quot;/&gt;
                          &lt;Label Text=&quot;{Binding Status}&quot; HorizontalOptions=&quot;EndAndExpand&quot; VerticalTextAlignment=&quot;Center&quot; HorizontalTextAlignment=&quot;End&quot;/&gt;
                        &lt;/StackLayout&gt;
                      &lt;/Frame&gt;
               &lt;/StackLayout&gt;
                   &lt;/DataTemplate&gt;
                  &lt;/CollectionView.ItemTemplate&gt;
                &lt;/CollectionView&gt;
              &lt;/StackLayout&gt;
            &lt;/StackLayout&gt;
          &lt;/Frame&gt;
        &lt;/DataTemplate&gt;
      &lt;/CollectionView.ItemTemplate&gt;
    &lt;/CollectionView&gt;
  </code></pre>
  <p>snapshot of outer &amp; inner collectionviews:</p>
  <p><a href="https://i.stack.imgur.com/6a35n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6a35n.png" alt="enter image description here" /></a></p>
  <p>I accented the colors to better see the layouts not shrinked.</p>
  <p>Questions : (I have tried multiple configurations but without solution)</p>
  <ol>
  <li>how can I shrink the StackLayouts to its contents?</li>
  <li>why the StackLayouts elongate greater the size of the screen?</li>
  </ol>