How shoud we customize platform view?

Morteza Abdollahiasl 0 Reputation points
2023-05-03T21:04:14.9066667+00:00

I wanted to replace native view of maui controls. How Should I do? For example on android I create a control that it is inherited from RecycleView. I want to replace my control with native view of CollectionView. I try to use platform view factory but it didn't work.

Developer technologies | .NET | .NET MAUI
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2023-05-08T08:47:46.6133333+00:00

    Hello,

    before maui I did it with Renderer in xamarin forms .

    If it works with renderer in Xamarin.Forms, you could try reuse custom renderers in .NET MAUI, take care to register renderers in the MauiProgram class. For example:

    .ConfigureMauiHandlers((handlers) =>
                {
    #if ANDROID
                    handlers.AddHandler(typeof(CollectionView), typeof(your RecycleView ));           
    #endif
                });
    

    If you have any other issues, please feel free to post in here.

    Best Regards,

    Wenyan Zhang


    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.