Hello there,

I am trying to implement the BaseAdapter to use with my Spinner, as
the data I want to bind to it is not just a string array. So I am
attempting to implement it, but it keeps throwing an exception that
the LayoutInflaters Inflate method is an Unkown Member.

My GetView method looks like this:

        public override View GetView(int position, View convertView,
ViewGroup parent)
        {
            UpdateFrequencyViewModel item =
updateFrequencyCollectionViewModel.ElementAt(position);

            var inflater = LayoutInflater.From(context);
            var view = convertView ??
inflater.Inflate(Resource.Layout.spinneritem, parent, false);

            var text = view.FindViewById(Resource.Id.text) as TextView;

            text.SetText(item.Text, TextView.BufferType.Normal);

            if (!_views.Contains(view))
                _views.Add(view);

            return view;
        }

Am I getting the wrong LayoutInflater or what am I doing wrong?

-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to