Esempio n. 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // 去标题栏
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.activity_main);
            mSlidingMenu = FindViewById<SlidingMenu>(Resource.Id.slidingMenu);
            mSlidingMenu.SetLeftView(LayoutInflater.Inflate(Resource.Layout.left_frame, null));
            mSlidingMenu.SetRightView(LayoutInflater.Inflate(Resource.Layout.right_frame, null));
            mSlidingMenu.SetCenterView(LayoutInflater.Inflate(Resource.Layout.center_frame, null));

            ft = this.SupportFragmentManager.BeginTransaction();
            leftFragment = new LeftFragment();
            rightFragment = new RightFragment();
            ft.Replace(Resource.Id.left_frame, leftFragment);
            ft.Replace(Resource.Id.right_frame, rightFragment);

            centerFragment = new SampleListFragment();
            ft.Replace(Resource.Id.center_frame, centerFragment);
            ft.Commit();
        }