コード例 #1
0
 public void checarImagen(string sexo, RecyclerViewHolder holder)
 {
     if (sexo.Equals("M"))
     {
         holder.imgSexo.SetImageResource(Resource.Drawable.icon_man);
     }
     else if (sexo.Equals("F"))
     {
         holder.imgSexo.SetImageResource(Resource.Drawable.icon_woman);
     }
 }
コード例 #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            RecyclerViewHolder viewHolder = holder as RecyclerViewHolder;

            viewHolder.txtNombre.Text    = lstPersona[position].nombre;
            viewHolder.txtEdad.Text      = "" + lstPersona[position].edad + "  años";
            viewHolder.txtOcupacion.Text = lstPersona[position].ocupacion;
            viewHolder.txtSexo.Text      = lstPersona[position].sexo;
            //viewHolder.imgSexo.SetImageResource(lstPersona[position].idImagen);
            checarImagen(viewHolder.txtSexo.Text, viewHolder);
            viewHolder.mRecycle.Click += lista_Click;
        }