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


C# RecyclerView.SetAdapter方法代码示例

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


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

示例1: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudyCardLayout, container, false);
            mRecyclerView = view.FindViewById<RecyclerView> (Resource.Id.recyclerView);
            //mListView = view.FindViewById<ListView> (Resource.Id.lvToDoList);
            mFab = view.FindViewById<FloatingActionButton> (Resource.Id.fab);
            mFab.Click += (sender, e) => {
                createFragment(null,true);
            };
            mStudyGroup = new List<StudyGroup> ();
            StudyRequest asyncStudyRquest = new StudyRequest ();
            Task<StudyResponse> data = asyncStudyRquest.StudyRequestAsync (LoginInfo.username, LoginInfo.KEY);

            StudyResponse results = data.Result;
            List<StudyGroup> resultsList = new List<StudyGroup> (results.studyGroups);

            for (int i = 0; i <resultsList.Count; i++) {

                mStudyGroup.Add (resultsList[i]);
            }

            mLayoutManager = new LinearLayoutManager (view.Context);
            mRecyclerView.SetLayoutManager (mLayoutManager);
            mAdapter = new RecyclerAdapter (mStudyGroup,mRecyclerView,this);
            mRecyclerView.SetAdapter (mAdapter);

            return view;
        }
开发者ID:ScholarStation,项目名称:Android,代码行数:28,代码来源:StudyCardFrag.cs

示例2: OnCreate

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

            _persoon = Gegevens.GetPerson();
            _groep = Gegevens.CurrentGroup();

            SetContentView(Resource.Layout.Betaalscherm);

            _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            ImageView Avatar = _toolbar.FindViewById<ImageView>(Resource.Id.Avatar);
            TextView Title = _toolbar.FindViewById<TextView>(Resource.Id.Title);
            Title.Text = _groep.groepsnaam;

            foreach (var lid in _persoon.KrijgSchuldGroep(_groep))
            {
                deelnemers.Add(new ListItem(lid.Key, Resource.Drawable.iconn, lid.Value, _groep));
            }

            _adapter = new ListItemAdapter(ListItem.Session, deelnemers);
            _adapter.ItemClick += OnItemClick;
            _adapter.ItemLongClick += (sender, e) => {};

            _recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerview);
            _recyclerView.SetMinimumHeight(ConvertDptoPx(listItemHeight*deelnemers.Count));
            _recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            _recyclerView.SetScrollContainer(true);
            _recyclerView.NestedScrollingEnabled = false;
            _recyclerView.SetAdapter(_adapter);

            SetSupportActionBar(_toolbar);
            SupportActionBar.Title = "";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
        }
开发者ID:SansSkill,项目名称:Introproject,代码行数:35,代码来源:Betaalscherm.cs

示例3: OnCreate

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

            // Instantiate the photo album:
            mPhotoAlbum = new PhotoAlbum();

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

            // Get our RecyclerView layout:
			mRecyclerView = FindViewById<RecyclerView> (Resource.Id.recyclerView);

            //............................................................
            // Layout Manager Setup:

            // Use the built-in linear layout manager:
			mLayoutManager = new LinearLayoutManager (this);

            // Or use the built-in grid layout manager (two horizontal rows):
            // mLayoutManager = new GridLayoutManager
            //        (this, 2, GridLayoutManager.Horizontal, false);

            // Plug the layout manager into the RecyclerView:
            mRecyclerView.SetLayoutManager (mLayoutManager);

            //............................................................
            // Adapter Setup:

            // Create an adapter for the RecyclerView, and pass it the
            // data set (the photo album) to manage:
			mAdapter = new PhotoAlbumAdapter (mPhotoAlbum);

            // Register the item click handler (below) with the adapter:
            mAdapter.ItemClick += OnItemClick;

            // Plug the adapter into the RecyclerView:
			mRecyclerView.SetAdapter (mAdapter);

            //............................................................
            // Random Pick Button:

            // Get the button for randomly swapping a photo:
            Button randomPickBtn = FindViewById<Button>(Resource.Id.randPickButton);

            // Handler for the Random Pick Button:
            randomPickBtn.Click += delegate
            {
                if (mPhotoAlbum != null)
                {
                    // Randomly swap a photo with the top:
                    int idx = mPhotoAlbum.RandomSwap();

                    // Update the RecyclerView by notifying the adapter:
                    // Notify that the top and a randomly-chosen photo has changed (swapped):
                    mAdapter.NotifyItemChanged(0);
                    mAdapter.NotifyItemChanged(idx);
                }
            };
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:60,代码来源:MainActivity.cs

示例4: OnCreate

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

			setup();

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

			drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			drawerList = FindViewById<RecyclerView>(Resource.Id.left_drawer);

			drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow, GravityCompat.Start);
			drawerList.SetLayoutManager(new LinearLayoutManager(this));
			adapter = new MenuAdapter();
			drawerList.SetAdapter(adapter);

			// enable ActionBar app icon to behave as action to toggle nav drawer
			this.ActionBar.SetDisplayHomeAsUpEnabled(true);
			this.ActionBar.SetHomeButtonEnabled(true);
			this.ActionBar.Title = "Test";
			drawerToggle = new MainDrawerToggle(this, drawerLayout,
				Resource.Drawable.ic_drawer,
				Resource.String.drawer_open,
				Resource.String.drawer_close);

			drawerLayout.AddDrawerListener(drawerToggle);

			drawerLayout.CloseDrawer(drawerList);
			vm.NavigatedTo(null);
		}
开发者ID:holtsoftware,项目名称:House,代码行数:31,代码来源:MainActivity.cs

示例5: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.PhotoLayout1);
            _RecyclerView = FindViewById<RecyclerView> (Resource.Id.recyclerView);

            var getRequest = new GetRequest ();
            var getResponse = new GetResponse ();
            getRequest.apiKey = "7gXV0uUd54z3ksYKMAG4co595dDPMaTB";
            getRequest.accessToken = "W88EaRR8PiKZXzoDe16eqlnt96CRSj0WFeEfy9ie9N565frGPqM4OVMKVOEdo9qGrYuT4ifeS2eNqrx3P6cBG6hTB3uTFfZawyOh";
            getRequest.langCode = "en-GB";
            String url = String.Format ("http://api.powhealth.com/LabTestService.svc/api/labtests/byuser/list/{0}/{1}/{2}", getRequest.apiKey, getRequest.accessToken, getRequest.langCode);

            WebRequest request = WebRequest.Create (url);
            WebResponse response = request.GetResponse ();

            var dataStream = response.GetResponseStream ();
            StreamReader reader = new StreamReader (dataStream);
            string responseFromServer = reader.ReadToEnd ();
            reader.Close ();
            response.Close ();
            var jsonObject = JsonConvert.DeserializeObject <GetResponse> (responseFromServer);

            //_LayoutManager = new LinearLayoutManager (this);
            _LayoutManager = new GridLayoutManager (this, 2, GridLayoutManager.Vertical, false);
            _RecyclerView.SetLayoutManager (_LayoutManager);
            _Adapter = new RecyclerAdapter (jsonObject.LabTestsUserOnlyResult, _RecyclerView);
            _RecyclerView.SetAdapter (_Adapter);
        }
开发者ID:RasaCosmin,项目名称:DropboxApp,代码行数:29,代码来源:PhotoActivity.cs

示例6: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.activity_recycler_view_add_remove);
			ActionBar.SetDisplayHomeAsUpEnabled (true);
			ActionBar.SetDisplayShowHomeEnabled (true);
			ActionBar.SetIcon (Android.Resource.Color.Transparent);

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


			layoutManager = new LinearLayoutManager (this);
			recyclerView.SetLayoutManager (layoutManager);

			adapter = new RecyclerAdapter (new List<RecyclerItem>());
			recyclerView.SetAdapter (adapter);
			recyclerView.SetItemAnimator (new DefaultItemAnimator ());

			FindViewById<Button>(Resource.Id.add).Click += (sender, e) => {
				adapter.Add(new RecyclerItem { Title = "New Item: " + adapter.ItemCount });
			};

			adapter.OnItemClick = (view, item) => {
				adapter.Remove(adapter.Items.IndexOf(item));
			};
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:27,代码来源:RecyclerViewActivityAddRemove.cs

示例7: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView (inflater, container, savedInstanceState);

            View View = inflater.Inflate (Resource.Layout.StatsPopUp, container, false);
            StatsView = View.FindViewById<RecyclerView> (Resource.Id.statsContainer);

            StatsLayoutManager = new LinearLayoutManager (Activity);
            StatsView.SetLayoutManager (StatsLayoutManager);
            StatsList = new List<Statistic> ();
            StatsList.Add (new Statistic () {
                Name = "Leben",
                Description = "Leben des Helden",
                Value = 2,
                Image = Resource.Drawable.heart
            });
            StatsList.Add (new Statistic () { Name = "Mana", Value = 20000000, Image = Resource.Drawable.heart });
            StatsList.Add (new Statistic () { Name = "Stärke", Value = 552, Image = Resource.Drawable.heart });
            StatsList.Add (new Statistic () { Name = "Schnelligkeit", Value = 23, Image = Resource.Drawable.heart });
            StatsList.Add (new Statistic () { Name = "Intelligenz", Value = 42, Image = Resource.Drawable.heart });
            StatsList.Add (new Statistic () { Name = "Ansehen", Value = 12, Image = Resource.Drawable.heart });
            StatsList.Add (new Statistic ());
            StatsView.SetAdapter (new StatisticRecyclerAdapter (StatsList));
            return View;
        }
开发者ID:Nuckal777,项目名称:mapKnight,代码行数:28,代码来源:StatsPopUp.cs

示例8: OnCreate

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

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

            activityIndicator.Visibility = Android.Views.ViewStates.Visible;

            layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);

            recyclerView.SetLayoutManager(layoutManager);

            var repository = new MoviesRepository();

            var films = await repository.GetAllFilms();

            var moviesAdapter = new MovieAdapter(films.results);

            recyclerView.SetAdapter(moviesAdapter);

            activityIndicator.Visibility = Android.Views.ViewStates.Gone;

            SupportActionBar.SetDisplayHomeAsUpEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(false);
        }
开发者ID:vkoppaka,项目名称:31DaysOfXamarinAndroid,代码行数:26,代码来源:MainActivity.cs

示例9: 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

示例10: OnCreateView

		public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
		{
			var ignored = base.OnCreateView (inflater,container,savedInstanceState);
			var view = (ViewGroup)inflater.Inflate (Resource.Layout.layout_news, null);
			var viewGroup = (ViewGroup)inflater.Inflate (Resource.Layout.layout_group, null);
			string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
			//NewsDetail = new NewsFragmentDetail ();

			//var mFragmentItemContainer = viewGroup.FindViewById<FrameLayout> (Resource.Id.fragment4Container);

			Button button = viewGroup.FindViewById<Button> (Resource.Id.btnDetalle);

			mFrameLayoutContainer = view.FindViewById<FrameLayout> (Resource.Id.RelativeLay);

			var trans = Activity.SupportFragmentManager.BeginTransaction ();
			//trans.Add (mFragmentItemContainer.Id, new NewsFragmentDetail (), "Detail");
			//trans.Add (Resource.Id.layout_content, NewsDetail);
			//trans.Hide (NewsDetail);
			mCurrentFragment = this;
			trans.Commit ();


			mRecyclerView = view.FindViewById<RecyclerView> (Resource.Id.RecyclerViewer);
			//Pruebas

			//cocoservices.tinnova.mx.COCOService cliente = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
			//Navigation_View.cocoservices.tinnova.mx.PublicationDTO[] mPublicacion = new Navigation_View.cocoservices.tinnova.mx.PublicationDTO[5];

			//Produccion

			services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();
			Navigation_View.services_911consumidor_com.PublicationDTO[] mPublicacion = new Navigation_View.services_911consumidor_com.PublicationDTO[5];

			mPublicacion = cliente.GetActivePublications (string_key);
			mPublicaciones = new List<Publicaciones> ();

			foreach (PublicationDTO value in mPublicacion) {
				mPublicaciones.Add (new Publicaciones {
					Titulo = value.Tittle,
					FechaPublicacion = value.PublicationDate,
					Subtitulo = value.SubTittle,
					Imagen = value.ImageUrl,
					IdPublicacion = value.Id,
					Contenido = value.Content
				});
			}

			mLayoutManager = new LinearLayoutManager (view.Context);
			mRecyclerView.SetLayoutManager (mLayoutManager);
			mAdapter = new adapter_listview (mPublicaciones, mRecyclerView, view.Context);
			mRecyclerView.SetAdapter (mAdapter);


			return view;
			// Create your fragment here
		}
开发者ID:AbrahamTheCoder,项目名称:TINNOVA.COCO.ANDROID,代码行数:56,代码来源:NewsFragment.cs

示例11: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = (View) inflater.Inflate(Resource.Layout.cardView_layout,container, false);

            //CardView
            mRecyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView);
            mCardViewHuoJing = new List<CardViewHuoJing>();

            FragmentManager fragmentManager1 = this.FragmentManager;

            string strURL=  this.Resources.GetString(Resource.String.HttpUri)+ String.Format("andriod/bjxx_intime_andriod.jsp?") + String.Format("userId={0}&userType={1}",LogInfoCardView.userId,LogInfoCardView.userType);

            Console.WriteLine (strURL);
            mHttpRequestCardView.HttpRequestFunc (strURL);

            doc.LoadXml(mHttpRequestCardView.HttpRecv);
            foreach (XmlNode node in doc.SelectNodes("FireIntime/Info/Fire"))
            {

                mCardViewHuoJing.Add (new CardViewHuoJing (){

                    bjxxbh=node.Attributes["bjxxbh"].Value,
                    dwmc=node.Attributes["dwmc"].Value,
                    lxdz=node.Attributes["lxdz"].Value,
                    lxr=node.Attributes["lxr"].Value,
                    khlb=node.Attributes["khlb"].Value,
                    gddh=node.Attributes["gddh"].Value,
                    bjdz=node.Attributes["bjdz"].Value,
                    asebh=node.Attributes["asebh"].Value,
                    ipphone=node.Attributes["ipphone"].Value,
                    quhao=node.Attributes["quhao"].Value,
                    bjsj=node.Attributes["bjsj"].Value,
                    bjjb=node.Attributes["bjjb"].Value,
                    flag=node.Attributes["flag"].Value,
                    bn=node.Attributes["bn"].Value

                });

            }

            //mCardViewHuoJing.Add(new Email() { Name = "tom", Subject = "Wanna hang out?", Message = "I'll be around tomorrow!!" });

            mLayoutManager = new LinearLayoutManager(Application.Context);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mAdapter = new RecyclerAdapter(mCardViewHuoJing, mRecyclerView,1,Application.Context,fragmentManager1);
            mRecyclerView.SetAdapter(mAdapter);

            //swipeRefresh
            mSwipeRefreshLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.swipeLayout);
            mSwipeRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloPurple);
            mSwipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh;

            //mRecyclerView.Click += mRecyclerView_Click;

            return view ;
        }
开发者ID:coroner4817,项目名称:ShangShuiXiaoFang,代码行数:56,代码来源:cardViewFragment.cs

示例12: OnActivityCreated

        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);
            mRecyclerView = (RecyclerView)mParentView.FindViewById(Resource.Id.recycler_view).JavaCast<RecyclerView>();

            LinearLayoutManager manager = new LinearLayoutManager(mRecyclerView.Context);
            manager.Orientation=LinearLayoutManager.Horizontal;
            mRecyclerView.SetLayoutManager(manager);
            mRecyclerView.SetAdapter(new RecyclerViewAdapter(Activity));
        }
开发者ID:huguodong,项目名称:XamandroidSupportDesign22.2.0.0,代码行数:10,代码来源:ShareFragment.cs

示例13: FindAndBindViews

 public void FindAndBindViews()
 {
     mRecycler = FindViewById<RecyclerView>(Resource.Id.rvList);
     mRecycler.SetLayoutManager(new LinearLayoutManager(this));
     refresher = FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
     refresher.Refresh += (sender, e) => OnRefresh(sAccount);
     refresher.SetColorSchemeResources(Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloGreenLight);
     mAdapter = new BaseRecyclerViewAdapter<UserModel, UserViewHolder>(BaseContext, new List<UserModel>(), Resource.Layout.Item_UserView);
     mRecycler.SetAdapter(mAdapter);
 }
开发者ID:lsgsk,项目名称:AndroidPatterns,代码行数:10,代码来源:MainActivity.cs

示例14: OnCreate

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

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

			var refreshbattery = FindViewById<Button> (Resource.Id.refresh_battery);
			var batterystatus = FindViewById<TextView> (Resource.Id.battery_status);
			var batterylevel = FindViewById<TextView> (Resource.Id.battery_level);

			refreshbattery.Click += (sender, e) => {
				var filter  = new IntentFilter(Intent.ActionBatteryChanged);
				var battery = RegisterReceiver(null, filter);
				int level   = battery.GetIntExtra(BatteryManager.ExtraLevel, -1);
				int scale   = battery.GetIntExtra(BatteryManager.ExtraScale, -1);

				batterylevel.Text = string.Format("Current Charge: {0}%", Math.Floor (level * 100D / scale));

				// Are we charging / charged? works on phones, not emulators must check how.
				int status = battery.GetIntExtra(BatteryManager.ExtraStatus, -1);
				var isCharging = status == (int)BatteryStatus.Charging || status == (int)BatteryStatus.Full;

					// How are we charging?
				var chargePlug = battery.GetIntExtra(BatteryManager.ExtraPlugged, -1);
				var usbCharge = chargePlug == (int)BatteryPlugged.Usb;
				var acCharge = chargePlug == (int)BatteryPlugged.Ac;
				var wirelessCharge = chargePlug == (int)BatteryPlugged.Wireless;

				isCharging = (usbCharge || acCharge || wirelessCharge);
				if(!isCharging){
					batterystatus.Text = "Status: discharging";
				} else if(usbCharge){
					batterystatus.Text = "Status: charging via usb";
				} else if(acCharge){
					batterystatus.Text = "Status: charging via ac";
				} else if(wirelessCharge){
					batterystatus.Text = "Status: charging via wireless";
				}
			};
				
			recyclerView = FindViewById<RecyclerView> (Resource.Id.recycler_view);
			recyclerView.HasFixedSize = true;


			layoutManager = new LinearLayoutManager (this);
			recyclerView.SetLayoutManager (layoutManager);

			var items = new List<RecyclerItem> (100);
			for(int i = 0; i < 100; i++)
				items.Add(new RecyclerItem{Title = "Item: " + i});

			adapter = new RecyclerAdapter (items);
			recyclerView.SetAdapter (adapter);
		}
开发者ID:IanLeatherbury,项目名称:mini-hacks,代码行数:55,代码来源:MainActivity.cs

示例15: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			View v = inflater.Inflate(Resource.Layout.view_recycler, container, false);

			recyclerView = v.FindViewById<RecyclerView> (Resource.Id.recycler_view);
			recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
			recyclerView.AddItemDecoration (new SettingsAdapter.SettingsItemDecoration (Activity));
			recyclerView.SetAdapter(new SettingsAdapter(Activity, settings));

			return v;
		}
开发者ID:edcombs,项目名称:StudyEspanol,代码行数:12,代码来源:SettingsView.cs


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