Пример #1
0
		public override View GetView(int position, View convertView, ViewGroup parent)
		{
			var view = convertView;
			TaskAdapterViewHolder holder = null;

			if (view != null)
				holder = view.Tag as TaskAdapterViewHolder;

			if (holder == null)
			{
				holder = new TaskAdapterViewHolder();
				var inflater = context.GetSystemService(Context.LayoutInflaterService).JavaCast<LayoutInflater>();
				//replace with your item and your holder items
				//comment back in
				view = inflater.Inflate(Resource.Layout.item_task, parent, false);
				holder.Name = view.FindViewById<TextView>(Resource.Id.task_name);
				holder.Photo = view.FindViewById<ImageView>(Resource.Id.task_photo);
				view.Tag = holder;
			}

			holder.Photo.SetImageResource (icons [position]);
			holder.Name.Text = names [position];

			return view;
		}
Пример #2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView;
            TaskAdapterViewHolder holder = null;

            if (view != null)
            {
                holder = view.Tag as TaskAdapterViewHolder;
            }

            if (holder == null)
            {
                holder = new TaskAdapterViewHolder();
                var inflater = context.GetSystemService(Context.LayoutInflaterService).JavaCast <LayoutInflater>();
                //replace with your item and your holder items
                //comment back in
                view         = inflater.Inflate(Resource.Layout.item_task, parent, false);
                holder.Name  = view.FindViewById <TextView>(Resource.Id.task_name);
                holder.Photo = view.FindViewById <ImageView>(Resource.Id.task_photo);
                view.Tag     = holder;
            }

            holder.Photo.SetImageResource(icons [position]);
            holder.Name.Text = names [position];

            return(view);
        }