本文整理汇总了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);
}
示例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);
}
}
示例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());
}