Exemplo n.º 1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView;
              MyViewHolder holder = null;

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

              if (holder == null)
              {
            holder = new MyViewHolder();
            var inflater = context.GetSystemService(Context.LayoutInflaterService).JavaCast<LayoutInflater>();
            view = inflater.Inflate(Resource.Layout.item_menu, parent, false);
            holder.Title = view.FindViewById<TextView>(Resource.Id.text);
            view.Tag = holder;

              }

              if (position == 0 && convertView == null)
            holder.Title.SetTypeface(holder.Title.Typeface, TypefaceStyle.Bold);
              else
            holder.Title.SetTypeface(holder.Title.Typeface, TypefaceStyle.Normal);

              holder.Title.Text = sections[position].Item2;
              holder.Title.SetCompoundDrawablesWithIntrinsicBounds(sections[position].Item1, 0, 0, 0);

              return view;
        }