listview也许是用的非常频繁的一个控件之一,下面我写一个xamarin的listview栗子,大家尝一尝xamarin android开发的乐趣。原谅我的大小写吧.
listview绑定自定义的BaseAdapter
先来看一下最终实现的效果图:
News.cs 和NewAdapter.cs
namespace DrawerLayout.Adapter
{
public class News {
public int Pv { get; set; }
public string Title { get; set; }
public News(string title,int Pv)
{
this.Title = title;
this.Pv = Pv;
}
}
public class NewsAdapter : BaseAdapter
{
private List<News> data;
private Context context;
public override int Count
{