question

njsokalski avatar image
0 Votes"
njsokalski asked ·

RecyclerView for Xamarin.Forms

In my attempt to convert my UWP apps for use on Android, I obviously need to learn Xamarin. One of my favorite controls in UWP was ItemsControl. When I first tried converting to a Xamarin.Android project, I tried to use android.support.v7.widget.RecyclerView. However, with the upcoming .NET 6 MAUI being based on Xamarin.Forms, I am being forced to write the app using Xamarin.Forms instead of Xamarin.Android (even though I never intend to convert it for anything other than Android), which does not allow me to use android.support.v7.widget.RecyclerView (at least not in the shared project's .xaml files). Is there a control available in Xamarin.Forms that is similar to RecyclerView, or will I need to transfer my UI XAML from the shared XAML files to the .xml files in the Android project? I don't want to use both, because they are both very different, and being new to Xamarin, I would prefer to only need to learn one new flavor of XAML. Thanks.

dotnet-xamarinforms-xaml
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is there a control available in Xamarin.Forms that is similar to RecyclerView or will I need to transfer my UI XAML from the shared XAML files to the .xml files in the Android project?

If you use xamarin.forms. you could use CollectionView, https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/, When you running CollectionView in android deivce, actually, CollectionView is RecyclerView, you can see the custom renderer for CollectionView. https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/renderers#views

48717-image.png


0 Votes 0 ·
image.png (36.7 KiB)

0 Answers