A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Hello,
This is a known issue and the developers are working on a fix, please keep track of EmptyViewTemplate does not do anything #18551.
As a temporary solution, you could put the CollectionView in the RefreshView.
<RefreshView>
<CollectionView ItemsSource="{Binding Monkeys}"
Grid.Row="1" MinimumHeightRequest="400">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Text="tst"/>
</DataTemplate>
</CollectionView.ItemTemplate>
<CollectionView.EmptyView>
<ContentView>
<StackLayout HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand">
<Label Text="No results matched your filter."
Margin="10,25,10,10"
FontAttributes="Bold"
FontSize="18"
HorizontalOptions="Fill"
HorizontalTextAlignment="Center" />
<Label Text="Try a broader filter?"
FontAttributes="Italic"
FontSize="12"
HorizontalOptions="Fill"
HorizontalTextAlignment="Center" />
</StackLayout>
</ContentView>
</CollectionView.EmptyView>
</CollectionView>
</RefreshView>
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.