Hello,
Welcome to our Microsoft Q&A platform!
What needs to be done so that the height of the CollectionView changes depending on the height of its elements
To do this, please set the RowDefinition's value of the Grid to Auto. And specify the a fixed value to the imageView's HeightRequest. Check the code:
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="0, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="8*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="{Binding xxx}" />
<Image Grid.Row="0" Grid.Column="1" Source="test" HeightRequest="35"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.