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


C# RecyclerView.SetOnScrollListener方法代码示例

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


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

示例1: OnCreate

		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.recyclerview);

			recyclerView = FindViewById<RecyclerView> (Resource.Id.recycler_view);

			// Layout Managers:
			recyclerView.SetLayoutManager (new LinearLayoutManager (this));

			// Item Decorator:
			recyclerView.AddItemDecoration (new DividerItemDecoration (Resources.GetDrawable (Resource.Drawable.divider)));
			recyclerView.SetItemAnimator (new FadeInLeftAnimator ());

			// Adapter:
			var adapterData = new [] {
				"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", 
				"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", 
				"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", 
				"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", 
				"Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", 
				"New Hampshire", "New Jersey", "New Mexico", "New York", 
				"North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", 
				"Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", 
				"Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", 
				"West Virginia", "Wisconsin", "Wyoming"
			};
			adapter = new RecyclerViewAdapter (this, adapterData.ToList ());
			adapter.Mode = Attributes.Mode.Single;
			recyclerView.SetAdapter (adapter);

			// Listeners
			recyclerView.SetOnScrollListener (new ScrollListener ());
		}
开发者ID:Dealtis,项目名称:oldDMS_3,代码行数:34,代码来源:RecyclerViewExample.cs

示例2: AttachToRecyclerView

 public void AttachToRecyclerView (RecyclerView recyclerView, IScrollDirectorListener scrollDirectionListener = null, RecyclerView.OnScrollListener onScrollListener = null)
 {
   var scrollDetector = new RecyclerViewScrollDetectorImpl (this);
   scrollDetector.ScrollDirectionListener = scrollDirectionListener;
   scrollDetector.OnScrollListener = onScrollListener;
   scrollDetector.ScrollThreshold = scrollThreshold;
   recyclerView.SetOnScrollListener (scrollDetector);
 }
开发者ID:sgarcia-dev,项目名称:xamarin-examples,代码行数:8,代码来源:FloatingActionButton.cs

示例3: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var ctx = inflater.Context;
			var view = inflater.Inflate (Resource.Layout.RentalsLayout, container, false);
			refreshLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.refresh_layout);

			refreshLayout.SetColorSchemeResources (Resource.Color.swipe_refresh_color_main,
			                                       Resource.Color.swipe_refresh_color_shade1,
			                                       Resource.Color.swipe_refresh_color_shade2,
			                                       Resource.Color.swipe_refresh_color_shade3);
			refreshLayout.Refresh += (sender, e) => Refresh (reset: false);

			recycler = view.FindViewById<RecyclerView> (Resource.Id.recycler);
			layoutManager = new LinearLayoutManager (ctx) {
				SmoothScrollbarEnabled = true,
			};
			recycler.HasFixedSize = true;
			recycler.SetLayoutManager (layoutManager);
			recycler.SetOnScrollListener (new LoadingScrollListener (this));

			loadingLayout = view.FindViewById (Resource.Id.loading_layout);

			loginLayout = view.FindViewById (Resource.Id.login_layout);
			loginBtn = loginLayout.FindViewById<Button> (Resource.Id.loginBtn);
			statusText = loginLayout.FindViewById<TextView> (Resource.Id.loginStatusText);
			username = loginLayout.FindViewById<EditText> (Resource.Id.username);
			password = loginLayout.FindViewById<EditText> (Resource.Id.password);

			SwitchLayoutPhase (LayoutPhase.List);

			return view;
		}
开发者ID:rameshvoltella,项目名称:Moyeu,代码行数:32,代码来源:RentalMaterialFragment.cs


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