当前位置: 首页>>代码示例>>C#>>正文


C# ViewPager.SetPageTransformer方法代码示例

本文整理汇总了C#中ViewPager.SetPageTransformer方法的典型用法代码示例。如果您正苦于以下问题:C# ViewPager.SetPageTransformer方法的具体用法?C# ViewPager.SetPageTransformer怎么用?C# ViewPager.SetPageTransformer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ViewPager的用法示例。


在下文中一共展示了ViewPager.SetPageTransformer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.MainMenuForGuest);

            _context = this;

            _pager = FindViewById<ViewPager>(Resource.Id.pager);
            _adapter = new ViewPagerAdapter(this, FragmentManager);

            _pager.SetPageTransformer(true, new ParallaxPageTransformer());
            _pager.Adapter = _adapter;
            _adapter.ViewPager = _pager;

            ViewPagerChangeListener pageChangeListener = new ViewPagerChangeListener(_pager, delegate(int position, int positionOffsetPixels)
                {
                    // Write something
                });

            _pager.AddOnPageChangeListener(pageChangeListener);

            _adapter.Campaigns = ItemFactory.Create();
            _pager.SetCurrentItem(1, false);
        }
开发者ID:anhvule,项目名称:ParallaxViewPager.XamarinAndroid,代码行数:26,代码来源:MainActivity.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //requesting features must be called before calling setcontentview
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.Main);

            mViewPager = FindViewById<ViewPager>(Resource.Id.viewpager);
            //set adapter
            //set page transformer

            mIntroAdapter = new IntroAdapter(this.SupportFragmentManager);
            mViewPager.Adapter = mIntroAdapter;

            //event handlers help to identify the last page
            mViewPager.PageScrolled += MViewPager_PageScrolled;
            mViewPager.PageSelected += MViewPager_PageSelected;
            mViewPager.PageScrollStateChanged += MViewPager_PageScrollStateChanged;

            IntroPageTransformer transformer = new IntroPageTransformer();
            mViewPager.SetPageTransformer(false, transformer);

            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this);
            bool isfirstime = prefs.GetBoolean("launched_once", false);

            if ( !isfirstime )
            {
                ISharedPreferencesEditor editor = prefs.Edit();
                editor.PutBoolean("launched_once", true);
                // editor.Commit();    // applies changes synchronously on older APIs
                editor.Apply();        // applies changes asynchronously on newer APIs
            }
            else
            {
                StartActivity(typeof(ExistingListActivity));
                this.OverridePendingTransition(Resource.Animation.slide_in_top, Resource.Animation.slide_out_bottom);
            }
        }
开发者ID:winifredrayen,项目名称:commondepot,代码行数:39,代码来源:MainActivity.cs

示例3: DisplayContent

        /// <summary>
        /// Show the content once it is ready
        /// </summary>
        private void DisplayContent()
        {
            SetContentView(Resource.Layout.GuideActivity);

            adapter = new GuideAdapter(SupportFragmentManager, guide.Guides, resources);
            pager = FindViewById<ViewPager>(Resource.Id.guide_pager);
            pager.Adapter = adapter;
            pager.SetPageTransformer(true, new DepthPageTransformer());
        }
开发者ID:GSDan,项目名称:Speeching_Client,代码行数:12,代码来源:GuideActivity.cs


注:本文中的ViewPager.SetPageTransformer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。