且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将json数组响应绑定到xamarin android中listview中的列表行

更新时间:2022-02-14 02:42:47

public override View GetView(int position, View convertView, ViewGroup parent)
    {
        TableItem item;

        if (position == 0 {
          item = new TableItem { DDLValue = "Select" };
        } else {
          item = items[position - 1];
        }

        View view = convertView;

        if (view == null) // no view to re-use, create new
            view = context.LayoutInflater.Inflate(Resource.Layout.CustomView, null);
        view.FindViewById<TextView>(Resource.Id.Text1).Text = item.DDLValue;

        return view;
    }