Esempio n. 1
0
        void LoadFragment(int id)
        {
            Fragment fragment = null;

            switch (id)
            {
            case Resource.Id.menu_home:
                Fragment s = new HairListFragment();
                fragment = s;
                break;

            case Resource.Id.menu_audio:
                fragment = BookingStatusListFragment.NewInstance();
                break;

            case Resource.Id.menu_video:
                fragment = Fragment4.NewInstance();
                break;
            }
            if (fragment == null)
            {
                return;
            }

            FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame2, fragment).Commit();
            //   Activity.SupportFragmentManager.BeginTransaction().Remove(fragment);


            //Activity.SupportFragmentManager.BeginTransaction()
            //  .Add(Resource.Id.content_frame, fragment)
            //  .Commit();
        }
Esempio n. 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.fragment1, container, false);
            FragmentTransaction ft = FragmentManager.BeginTransaction();
            Fragment            f  = null;

            f = new HairListFragment();
            ft.Add(Resource.Id.content_frame2, f).Commit();

            bottomNavigation = view.FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation);
            bottomNavigation.NavigationItemSelected += BottomNavigation_NavigationItemSelected;
            return(view);
        }