What's the exact exception that you're getting, complete with stack trace?
Also, most code I've seen uses `LayoutInflater.Inflate(...)`, not
`LayoutInflater.From(context).Inflate(...)`. Could you try skipping the
`LayoutInflater.From(context)` call and use `LayoutInflater.Inflate()` instead?
Thanks,
- Jon
On Sep 30, 2011, at 10:23 AM, Tomasz Cielecki wrote:
> 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
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid