Gmail like navigation drawer (master page) in xamarin.forms

前端 未结 2 869
不知归路
不知归路 2021-01-22 12:34

I am currently using the master-detail page in xamarin.forms using MVVMlight and it renders based on the default behavior of os it renders perfectly what I wanted but in android

2条回答
  •  借酒劲吻你
    2021-01-22 13:34

    Use FormsAppCompatActivity instead of FormsApplicationActivity.

    define your own toolbar.axml

    toolbar.axml

    
    
    
    

    Set your own ToolbarResource

    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
        {
            protected override void OnCreate(Bundle bundle)
            {
                ToolbarResource = Resource.Layout.toolbar;
                base.OnCreate(bundle);
                global::Xamarin.Forms.Forms.Init(this, bundle);
                LoadApplication(new App());
            }
        }
    

提交回复
热议问题