Xamarin Forms Light Theme don't work

Hello i don't understand where i'm doing wrong. I'm doing a Xamarin forms PCL project for Androi and Ios, I added the xamarin.forms.theme.base and light to the shared , ios and android project. I put this code in my app xml

<?xml version="1.0" encoding="utf-8"?>

<Application.Resources>

</Application.Resources>

Then in my mainactivity android

[Activity(Label = "xwrmSmart.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{

        protected override void OnCreate(Bundle bundle)
    {

        base.OnCreate(bundle);
        global::Xamarin.Forms.Forms.Init(this, bundle);
        var x = typeof(Xamarin.Forms.Themes.LightThemeResources);
        x = typeof(Xamarin.Forms.Themes.Android.UnderlineEffect);
        LoadApplication(new App());
    }



}

and in my Ios app delegate
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//public static Xuni.Forms.Calendar.Platform.iOS.CalendarRenderer calDummy;
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();

        Popup.Init();
        global::Xamarin.Forms.Forms.Init();
        //Xuni.Forms.Calendar.Platform.iOS.Forms.Init();
        var x = typeof(Xamarin.Forms.Themes.LightThemeResources);
        x = typeof(Xamarin.Forms.Themes.iOS.UnderlineEffect);
        LoadApplication(new App());

        return base.FinishedLaunching(app, options);



    }
}

When i see my page on xamarin studio xaml viewer i see the style of the template; but when i lunch the application on the simulare it's like i have never add the theme.
What am i doing wrong?
ps: i also try to set this rows after the load application call:
var x = typeof(Xamarin.Forms.Themes.LightThemeResources);
x = typeof(Xamarin.Forms.Themes.iOS.UnderlineEffect);

Posts

Sign In or Register to comment.