Exemple #1
0
        private void TabLayoutViewPager()
        {
            tabLayout            = FindViewById <TabLayout>(Resource.Id.tab_layout);
            tabLayout.TabGravity = TabLayout.GravityFill;
            tabLayout.TabMode    = TabLayout.ModeScrollable;

            // PagerAdapter.FragmentPosition과 순서를 맞출것
            tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.work_path_fragment)));
            tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.weld_count_fragment)));
            tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.weld_condition_fragment)));
            tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.backup_path_fragment)));

            viewPager         = FindViewById <ViewPager>(Resource.Id.pager);
            pagerAdapter      = new PagerAdapter(SupportFragmentManager, tabLayout.TabCount);
            viewPager.Adapter = pagerAdapter;
            viewPager.AddOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
            tabLayout.SetOnTabSelectedListener(new TabLayoutOnTabSelectedListener(this, viewPager, actionBar, tabLayout));
        }
		private void TabLayoutViewPager()
		{
			tabLayout = FindViewById<TabLayout>(Resource.Id.tab_layout);
			tabLayout.TabGravity = TabLayout.GravityFill;
			tabLayout.TabMode = TabLayout.ModeScrollable;

			// PagerAdapter.FragmentPosition과 순서를 맞출것
			tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.work_path_fragment)));
			tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.weld_count_fragment)));
			tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.weld_condition_fragment)));
			tabLayout.AddTab(tabLayout.NewTab().SetText(Resources.GetString(Resource.String.backup_path_fragment)));

			viewPager = FindViewById<ViewPager>(Resource.Id.pager);
			pagerAdapter = new PagerAdapter(SupportFragmentManager, tabLayout.TabCount);
			viewPager.Adapter = pagerAdapter;
			viewPager.AddOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
			tabLayout.SetOnTabSelectedListener(new TabLayoutOnTabSelectedListener(this, viewPager, actionBar, tabLayout));
		}