Xamarin.Forms.Visual.Material Outlined Text fields

722 Views Asked by At

is any possibility to use Xamarin.Forms.Visual.Material NuGet package and set Text Fields style from Filled to Outlined without any custom renders for both platforms.

We already had it in Xamarin.Android only, but do we have it in Xamarin.Forms ???

Thanks

1

There are 1 best solutions below

4
ColeX On

Currently Xamarin.Forms.Visual.Materialpackage only supports Android and iOS .

The process for enabling Xamarin.Forms Material Visual in your application is:

  1. Add the Xamarin.Forms.Visual.Material NuGet package to your iOS and Android platform projects.(no need to install in Forms)

  2. Initialize Material Visual in each platform project.

    • Android: Add in MainActivity.cs

      global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
      global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);
      
    • iOS: Add in AppDelegate

      global::Xamarin.Forms.Forms.Init();
      global::Xamarin.Forms.FormsMaterial.Init();
      
  3. Create Material Visual controls by setting the Visual property to Material on any pages that should adopt the Material Design rules.


Refer to https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual/material-visual