How To Prevent Dark Mode In Xamarin.Forms | Vicente G. Guzmán Lucio

Vicente G. Guzmán Lucio

Tecnologías Disruptivas

How To Prevent Dark Mode In Xamarin.Forms

In this article we will see how to force the white or light mode in an application developed in Xamarin.Forms

Solution for iOS

Let’s open our info.plist file and add the following key:

<key>UIUserInterfaceStyle</key>
<string>Light</string>

Solution for Android

For the same thing to happen but in Android, we must put this code in the MainActivity.cs

Let’s remember to save the changes and if necessary recompile so that the changes are implemented in the applications.

Observations

Consider carrying out several previous tests before uploading changes to your repository or generating a version to publish in the respective stores of the mobile operating systems.

Share this:

Me gusta esto:

Navegador de artículos

Deja una respuesta

Por favor, inicia sesión con uno de estos métodos para publicar tu comentario:


Estás comentando usando tu cuenta de WordPress.com.
Salir / 
Cambiar )


Estás comentando usando tu cuenta de Google.
Salir / 
Cambiar )


Estás comentando usando tu cuenta de Twitter.
Salir / 
Cambiar )


Estás comentando usando tu cuenta de Facebook.
Salir / 
Cambiar )

Conectando a %s



Introduce tu dirección de correo electrónico para seguir este Blog y recibir las notificaciones de las nuevas publicaciones en tu buzón de correo electrónico.

Únete a 3.169 seguidores más







Sígueme en Twitter

Scroll al inicio