title | description | ms.service | ms.assetid | ms.subservice | author | ms.author | ms.date | no-loc | ||
---|---|---|---|---|---|---|---|---|---|---|
ListView Row Animations on iOS |
Platform-specifics allow you to consume functionality that's only available on a specific platform, without implementing custom renderers or effects. This article explains how to consume the iOS platform-specific that controls whether row animations are disabled when the ListView items collection is being updated. |
xamarin |
E8F5103F-4D8E-4A5A-A16C-7FA14EE786AC |
xamarin-forms |
davidbritch |
dabritch |
02/21/2019 |
|
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
.
- Creating Platform-Specifics
- iOSSpecific API