Forum Xamarin.iOS

How to set item template for iOS listview?

SuperDev.2956SuperDev.2956 USMember ✭✭

I need to change item template, aka view switching. Have two DataTemplate type resources in page dictionary.
Following trick works on Android and UWP, but not for iOS, even if I refresh item source.

        <ListView HasUnevenRows="True" ItemTemplate="{StaticResource ListLarge}">
            <ListView.Triggers>
                <DataTrigger TargetType="ListView"
                             Binding="{Binding SmallView}"
                             Value="True">
                    <Setter Property="ItemTemplate" Value="{StaticResource ListSmall}" />
                </DataTrigger>
            </ListView.Triggers>
            <x:Arguments>
                <ListViewCachingStrategy>RecycleElement</ListViewCachingStrategy>
            </x:Arguments>
        </ListView>

Guess I should write special render to push iOS change template of list. Anyone did something?

Sign In or Register to comment.