Del via


ListView Row Animations on iOS

This iOS platform-specific controls whether row animations are disabled when the ListView items collection is being updated. It's consumed in XAML by setting the ListView.RowAnimationsEnabled bindable property to false:

<ContentPage ...
             xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core">
    <StackLayout Margin="20">
        <ListView ... ios:ListView.RowAnimationsEnabled="false">
            ...
        </ListView>
    </StackLayout>
</ContentPage>

Alternatively, it can be consumed from C# using the fluent API:

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
...

listView.On<iOS>().SetRowAnimationsEnabled(false);

The ListView.On<iOS> method specifies that this platform-specific will only run on iOS. The ListView.SetRowAnimationsEnabled method, in the Xamarin.Forms.PlatformConfiguration.iOSSpecific namespace, is used to control whether row animations are disabled when the ListView items collection is being updated. In addition, the ListView.GetRowAnimationsEnabled method can be used to return whether row animations are disabled on the ListView.

Note

ListView row animations are enabled by default. Therefore, an animation occurs when a new row is inserted into a ListView.