-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ItemSizingStrategy MeasureAllItems does not work for iOS #5455
Comments
Reproduces as described. |
Is there any known work around (except setting height manually)? At the moment it's really useless with variable dynamic content. |
Agreed. This needs to be given priority, imo. |
With regards to ItemSizingStrategy, is https://gist.github.com/hartez/7d0edd4182dbc7de65cebc6c67f72e14 current? It is mentioned here (https://devblogs.microsoft.com/xamarin/xamarin-forms-4-0-feature-preview-an-entirely-new-point-of-collectionview/) as a way to keep track of this component. I spent some time today trying to use CollectionView on android, and found out that ItemSizingStrategy does not work. A more prominent display of status would have saved me some grief. And time. |
Is it correct? According to the spec, MeasureFirstItem should produce the same height/width, while MeasureAllItems should measure all items individually. |
|
Check for expanding column size during layout and re-center previous items in column; fixes #5455
Hi, did we have some news about this issue ? |
@PureWeen @samhouts is this shipped in the latest 4.6 stable that was just shipped yesterday? The release notes say it was. I updated my app to 4.6.0.726, and this is what I see. Once I scroll the view a little bit, then everything collapses correctly This is my xaml <RefreshView Command="{Binding RefreshCommand}"
IsRefreshing="{Binding IsRefreshing}">
<CollectionView x:Name="list"
BackgroundColor="Transparent"
ItemsSource="{Binding VisibleDataObjectCollection}"
ItemsUpdatingScrollMode="KeepScrollOffset"
ItemSizingStrategy="MeasureAllItems"
RemainingItemsThresholdReachedCommand="{Binding LoadNextPageCommand}"
RemainingItemsThreshold="{StaticResource RemainingItemsThreshold}"
SelectionMode="Single"
SelectionChangedCommand="{Binding ShowDetailsCommand}"
SelectionChangedCommandParameter="{Binding SelectedItem, Source={RelativeSource Self}}">
<CollectionView.Behaviors>
<behaviors:ClearSelectedItemAfterSelectionBehavior />
</CollectionView.Behaviors>
<CollectionView.ItemTemplate>
<templateSelectors:FieldListItemSelector x:DataType="models:FieldCropYearListModel">
<templateSelectors:FieldListItemSelector.FieldWithCropTemplate>
<DataTemplate>
<StackLayout Style="{StaticResource RepeaterStack}">
<controlTemplates:TwoRowListItemTemplate VerticalOptions="Fill"
HorizontalOptions="Fill"
PrimaryText="{Binding FieldName}"
SecondaryText="{Binding CropDescription}"
Color="{Binding SeedColour, Converter={StaticResource ColorConverter},ConverterParameter={StaticResource White}}" />
<BoxView Style="{StaticResource HorizontalDivider}" />
</StackLayout>
</DataTemplate>
</templateSelectors:FieldListItemSelector.FieldWithCropTemplate>
<templateSelectors:FieldListItemSelector.FieldWithoutCropTemplate>
<DataTemplate>
<StackLayout Style="{StaticResource RepeaterStack}">
<controlTemplates:SingleRowListItemTemplate VerticalOptions="Fill"
HorizontalOptions="Fill"
Text="{Binding FieldName}" />
<BoxView Style="{StaticResource HorizontalDivider}" />
</StackLayout>
</DataTemplate>
</templateSelectors:FieldListItemSelector.FieldWithoutCropTemplate>
</templateSelectors:FieldListItemSelector>
</CollectionView.ItemTemplate>
<CollectionView.EmptyView>
<controlTemplates:EmptyDataTemplate Text="{x:Static resx:AppResources.FieldsPage_ListEmptyMessage}" />
</CollectionView.EmptyView>
<CollectionView.Header>
<ContentView Padding="3" />
</CollectionView.Header>
<CollectionView.Footer>
<StackLayout Padding="6, 16">
<Button Text="{x:Static resx:AppResources.ActivityListPage_ClearFilter}"
Style="{StaticResource TextOnlyButton}"
IsVisible="{Binding HasFiltersApplied}"
Command="{Binding ClearFiltersCommand}" />
<ActivityIndicator HorizontalOptions="Center"
VerticalOptions="Center"
Color="{StaticResource PrussianBlue}"
IsRunning="{Binding IsLoadingPage}"
IsVisible="{Binding IsLoadingPage}" />
</StackLayout>
</CollectionView.Footer>
</CollectionView>
</RefreshView> |
@ChaseFlorell Can you please open a new issue? Thanks! |
@samhouts this appears to be the exact same issue. However, I won't be opening a new issue as I'm on my last ONE hour of this contract and I will not have any ability to do follow-up. Maybe someone else on the team wants to follow up. |
Any updates on this? |
Still no news here? |
This is still broken on iOS. Even with ItemSizingStrategy="MeasureAllItems", it only measures the first item and then applies that height to every row. Examp,e XAML below that exhibits this issue:
|
Description
I was playing around with the
CollectionView
on iOS and was facing problems with uneven row height. I saw there was anItemSizingStrategy
introduced lately, but it's still behaving weird though.Steps to Reproduce
DataTemplateGallery
CollectionViewGalleryMeasureAllItems
to get the following resultExpected Behavior
Items should have the same height / width when setting
ItemSizingStrategy
toMeasureAllItems
Actual Behavior
See above
Basic Information
The text was updated successfully, but these errors were encountered: