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

Compound Control not working in Xamarin? -Layout inflater cannot find class

$
0
0

I have created a new class that inherits from TwoLineListItem, following the Compound control/component pattern: http://developer.android.com/guide/topics/ui/custom-components.html#compound

public class CheckedTwoLineListItem : TwoLineListItem, ICheckable

I have also defined a CheckedSimpleListItem2.axml layout that uses this, e.g.:

<MyNamespace.CheckedTwoLineListItem xmlsn:android="..">
    <CheckedTextView android:id="@android:id/text1" />
    <TextView android:id="@android:id/text2" />
</MyNamespace.CheckedTwoLineListItem>

When I attempt to inflate this inside my ListAdapter GetView() method:

 var view = Context.LayoutInflater.Inflate(Resource.Layout.CheckedSimpleListItem2, null);

The layout inflater throws a 'Class not found' - CheckedTwoLineListItem.

The XML inflation is picking up my CheckedTwoLineListItem, but the Java inflater code can't find/see my CheckedTwoLineListItem.cs class for some reason.

What am I doing wrong?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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