When having a nested grid layouts with auto and definitive row heights, the content in the ListView ItemTemplate is not property sized only on iOS. On Android, MacCatalyst and WinUI the content is property sized.
Solution:
1. Using only auto-sized grid rows,
2. Using grouping and simplifying the layout, removing nested grid layouts, and using a vertical stack.
When setting margin to the elements in the template, the margin is not respected
Since migrating to MAUI .NET8 GA 8.0.3 (and Telerik 6.5) - on iOS the RadListView keeps repeatedly triggering the defined LoadOnDemand command to get more items even though list has not been scrolled by user.
the behavior is valid for the command, event and collection and when automatic load on demand mode is used.
When using manual mode, it works as expected.
Having ContentViews for left and right item swipe
The ListView crashes
The bug can be reproduced quite easily with the SDK examples. Choose any ListView example from the LoadOnDemand category that uses LoadOnDemandMode set to Automatic, e.g. ListView/LoadOnDemand/LoadOnDemandEvent. Remove the initial items from the ItemsSource:
public ViewModel()
{
this.Source = new ObservableCollection<string>();
//for (int i = 0; i < 14; i++)
//{
// this.Source.Add(string.Format("Item {0}", i));
//}
this.LoadItemsCommand = new Command(this.LoadItemsCommandExecute);
}
Run the example to observe the exception almost immediately.
It took me about 2 days, but finally i've reached out a repo out of the real world app, where the iOS RadListView crashes the app.
Start this repo app on a iPhone 15 Simulator:
https://github.com/baaaaif/TelerikListViewCrash
The ListView crashes the app when the cell is quite high and the height of the list and the height of the cell reach a certain (unknown) ratio
This is in the logs right before the crash :
Native Crash Reporting
TelerikListViewCrash : -[TKListViewLayoutChange applyToAll:] 0x1023126e0 - /Users/nicokuenzler/Library/Developer/CoreSimulator/Devices/47FE3DF0-D39D-427A-9E82-0FCD7B14D208/data/Containers/Bundle/Application/88F8A1C5-46EB-4C80-A80D-A2699030842A/TelerikListViewCrash.app/TelerikListViewCrash : -[TKListViewLayoutChangeManager optimize] 0x10237e174 - /Users/nicokuenzler/Library/Developer/CoreSimulator/Devices/47FE3DF0-D39D-427A-9E82-0FCD7B14D208/data/Containers/Bundle/Application/88F8A1C5-46EB-4C80-A80D-A2699030842A/TelerikListViewCrash.app/TelerikListViewCrash : -[TKListViewLinearLayout layoutAttributesForElementsInRect:] 0x184a7f6c4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UICollectionViewData _layoutAttributesForElementsInRectForMapping:] 0x185347778 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[_UICollectionViewDataAttributesMap _validateLayoutInRect:] 0x184a81770 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UICollectionViewData validateLayoutInRect:] 0x184a824d4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UICollectionViewData layoutAttributesForElementsInRect:] 0x184a444b4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UICollectionView _updateVisibleCellsNow:] 0x184a451c8 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UICollectionView _updateVisibleCellsNow:] 0x184a49ec4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UICollectionView layoutSubviews] 0x10240bce4 - /Users/nicokuenzler/Library/Developer/CoreSimulator/Devices/47FE3DF0-D39D-427A-9E82-0FCD7B14D208/data/Containers/Bundle/Application/88F8A1C5-46EB-4C80-A80D-A2699030842A/TelerikListViewCrash.app/TelerikListViewCrash : -[TKCollectionView layoutSubviews]
When the VerticalItemSpacing is greater than 1 and an ItemStyle with a Border is defined the background of the item is overlapping the border.
<telerik:RadListView Grid.Column="0" ItemsSource="{Binding Source}">
<telerik:RadListView.LayoutDefinition>
<telerik:ListViewLinearLayout Orientation="Vertical" VerticalItemSpacing="4" />
</telerik:RadListView.LayoutDefinition>
<telerik:RadListView.ItemStyle>
<telerik:ListViewItemStyle
BackgroundColor="Green"
BorderColor="LightGreen"
BorderLocation="All"
BorderWidth="1" />
</telerik:RadListView.ItemStyle>
<telerik:RadListView.SelectedItemStyle>
<telerik:ListViewItemStyle
BackgroundColor="Orange"
BorderColor="OrangeRed"
BorderLocation="All"
BorderWidth="1" />
</telerik:RadListView.SelectedItemStyle>
<telerik:RadListView.PressedItemStyle>
<telerik:ListViewItemStyle
BackgroundColor="Orange"
BorderColor="OrangeRed"
BorderLocation="All"
BorderWidth="1" />
</telerik:RadListView.PressedItemStyle>
<telerik:RadListView.ItemTemplate>
<DataTemplate x:DataType="local:SourceItem">
<telerik:ListViewTemplateCell>
<telerik:ListViewTemplateCell.View>
<Grid>
<Label Margin="10" Text="{Binding Name}" />
</Grid>
</telerik:ListViewTemplateCell.View>
</telerik:ListViewTemplateCell>
</DataTemplate>
</telerik:RadListView.ItemTemplate>
</telerik:RadListView>
I have a collection of items, and one of the properties notifies changes to the UI. ("BooleanProperty") I also bind to the SelectedItem property on the list view to toggle this bool property to true or false.
I have another property "Description" that I am sorting by. When sorting the ListView and select an item, the items with the same value are reordered.
Android: when tapping on load on demand template the data is not loaded.
If you use the LoadOnDemandCommand you can bind the command to the button inside the template.
On WinUI there is an exception runtime
Workaround:
Use automatic load on demand mode or bind the command to the template
if you start to reorder an item, and then drop it in the same position that it already had (i.e. abort/cancel the reorder) , the gray color is now stuck. The issue happens only on Android.