Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetToolBarNavBack();
            StatusBarUtil.SetColorStatusBars(this);
            SetToolBarTitle(Resources.GetString(Resource.String.myStatus));
            //ÏÔʾͼƬÅäÖÃ
            options = new DisplayImageOptions.Builder()
                      .ShowImageForEmptyUri(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnFail(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnLoading(Resource.Drawable.icon_user)
                      .CacheInMemory(true)
                      .BitmapConfig(Bitmap.Config.Rgb565)
                      .CacheOnDisk(true)
                      // .Displayer(new DisplayerImageCircle(20))
                      .Build();
            _viewPager = FindViewById <ViewPager>(Resource.Id.viewPager_home);
            _tab       = FindViewById <TabLayout>(Resource.Id.tab_home);
            string[] myStatusTabs = Resources.GetStringArray(Resource.Array.MyStatusTabs);
            adapter = new StatusTabsFragmentAdapter(SupportFragmentManager, myStatusTabs, true);

            _viewPager.Adapter            = adapter;
            _viewPager.OffscreenPageLimit = myStatusTabs.Length;
            _tab.TabMode = TabLayout.ModeFixed;
            _tab.SetupWithViewPager(_viewPager);
            _tab.SetOnTabSelectedListener(this);
        }
Ejemplo n.º 2
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            HasOptionsMenu = true;
            _viewPager     = view.FindViewById <ViewPager>(Resource.Id.viewPager_home);
            _tab           = view.FindViewById <TabLayout>(Resource.Id.tab_home);
            string[] statusTabs = Resources.GetStringArray(Resource.Array.StatusTabs);
            adapter = new StatusTabsFragmentAdapter(this.ChildFragmentManager, statusTabs);

            _viewPager.Adapter            = adapter;
            _viewPager.OffscreenPageLimit = statusTabs.Length;
            _tab.TabMode = TabLayout.ModeFixed;
            _tab.SetupWithViewPager(_viewPager);
            _tab.SetOnTabSelectedListener(this);
        }