コード例 #1
0
        private void PopulateTabStrip()
        {
            PagerAdapter adapter = mViewPager.Adapter;

            for (int i = 0; i < adapter.Count; i++)
            {
                TextView tabView = CreateDefaultTabView(Context);
                tabView.Text = ((SlidingTabsFragment.SamplePagerAdapter)adapter).GetHeaderTitle(i);
                tabView.SetTextColor(Android.Graphics.Color.Black);
                tabView.Tag    = i;
                tabView.Click += tabView_Click;
                mTabStrip.AddView(tabView);
            }
        }
コード例 #2
0
        //Adapte la page selon le nombre d'onglet (adapter.Count)
        private void PopulateTabStrip()
        {
            PagerAdapter adapter = mViewPager.Adapter;

            for (int i = 0; i < adapter.Count; i++)
            {
                TextView tabView = CreateDefaultTabView(Context);
                tabView.Text = ((SlidingTabsFragment.SamplePagerAdapter)adapter).GetHeaderTitle(i);
                tabView.SetTextColor(Android.Graphics.Color.Rgb(148, 205, 97));
                tabView.Tag    = i; //Cela nous permettra de retrouver une position
                tabView.Click += tabView_Click;
                mTabStrip.AddView(tabView);
            }
        }