コード例 #1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) // Fill in the contents of the photo card (invoked by the layout manager):
        {
            PhotoViewHolder vh = holder as PhotoViewHolder;

            // Set the ImageView and TextView in this ViewHolder's CardView
            // from this position in the photo album:
            //vh.Image.SetImageResource(mPhotoAlbum[position].PhotoID);
            Android.Graphics.Bitmap bmp = EventDetail_Intent.GetImageBitmapFromUrl(mPhotoAlbum[position].EventImagePath.Replace("https://", "http://"));
            vh.Image.SetImageBitmap(bmp);
            vh.Caption.Text = mPhotoAlbum[position].name;
        }
コード例 #2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) // Create a new photo CardView (invoked by the layout manager):
        {
            // Inflate the CardView for the photo:
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.PhotoCardView, parent, false);

            // Create a ViewHolder to find and hold these view references, and
            // register OnClick with the view holder:
            PhotoViewHolder vh = new PhotoViewHolder(itemView, OnClick);

            return(vh);
        }