Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to "TableItem" in a HomeScreenAdapter

$
0
0

Good day, I followed one of your example that explained how to use listview i.e to develop a custom listview appearance but when I'm done with everything to debug and run it, always come up with error that : The type or namespace name 'TableItem' could not be found(are you missing using directive or an assembly reference)

This is the code:

public class HomeScreenAdapter : BaseAdapter { List items; Activity context;

    public HomeScreenAdapter (Activity context, List<TableItem> items) : base()
    {
        this.context = context;
        this.items = items; 
    }

    public override long GetItemId (int position)
    {
        return position;
    }

    public override TableItem this[int position]
    {
        get { return items [position];}
    }

    public override int Count
    {
        get { return items.Count;}
    }

    public override View GetView(int position, View convertView, ViewGroup parent)
    {
        var item = items [position];
        View view = convertView;

        if (view == null)
        view = context.LayoutInflater.Inflate(Resource.Layout.CustomView, null);
        view.FindViewById<TextView> (Resource.Id.Text1).Text = item.Heading;
        view.FindViewById<TextView> (Resource.Id.Text2).Text = item.SubHeading;
        view.FindViewById<TextView> (Resource.Id.Image).setImageResource (item.ImageResourceId);
        return view;
    }
}

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>