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


C# ListView.SetSelector方法代码示例

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


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

示例1: InitView

		private void InitView()
		{
			//设置标题栏
			var img_header_back = FindViewById<ImageView> (Resource.Id.img_header_back);
			img_header_back.Click += (sender, e) => 
			{
				SetResult(Result.Canceled);
				this.Finish();
				OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			};
			var tv_back = FindViewById<TextView> (Resource.Id.tv_back);
			tv_back.Text = "返回";
			var tv_desc = FindViewById<TextView> (Resource.Id.tv_desc);
			tv_desc.Text = "选择银行卡";
			lv_bankType = FindViewById<ListView> (Resource.Id.lv_bankType);
			bankCardInfoListAdapter = new BankCardInfoListAdapter (this);

			lv_bankType.Adapter = bankCardInfoListAdapter;
			//设置滑动listview停止加载图片
			lv_bankType.SetOnScrollListener (new PauseOnScrollListener(Global.imageLoader,false,false));
			lv_bankType.SetSelector (Resource.Color.red);//设置被选中项颜色为红
			LoadTypeData ();
			//点击列表详细
			lv_bankType.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => 
			{
				var intent = new Intent();
				intent.PutExtra("choosebankTypeId",bankCardInfoListAdapter.GetItem(e.Position).BankCardTypeId);
				intent.PutExtra("choosebankImgUrl",bankCardInfoListAdapter.GetItem(e.Position).BankCardImageUrl);
				SetResult(Result.Ok,intent);
				this.Finish();
			};


		}
开发者ID:lq-ever,项目名称:CommunityCenter,代码行数:34,代码来源:ChooseBankTypeActivity.cs

示例2: OnCreate

		protected override void OnCreate ( Bundle savedInstanceState )
		{
			Global.LastActivity = this;
			base.OnCreate ( savedInstanceState );
			SetContentView ( Resource.Layout.SelectTest );

			if ( Load != null )
				Load ();

			buttonSelectTest = ( Button ) FindViewById ( Resource.Id.buttonStartTest );
			buttonSelectTest.Enabled = false;
			buttonSelectTest.Click += ( sender, e ) => {
				Intent intent = new Intent ( this, typeof ( TestActivity ) );
				intent.PutExtra ( TestActivity.TEST_ID_PARAM, listViewTests.CheckedItemPosition );
				StartActivity ( intent );
				Finish ();
			};

			listViewTests = ( ListView ) FindViewById ( Resource.Id.listViewTests );
			listViewTests.ChoiceMode = ChoiceMode.Single;
			listViewTests.SetSelector ( Resource.Color.selected_test );
			listViewTests.Adapter = new ArrayAdapter<string> ( this, Resource.Layout.ListTestsItem, Global.TestsNames );
			listViewTests.ItemClick += ( sender, e ) => buttonSelectTest.Enabled = true;
		}
开发者ID:nikulex,项目名称:PsychologicalTests,代码行数:24,代码来源:SelectTestActivity.cs


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