hi
I have read and looked at the xamarin project SubclassedNativeControls. And it works fine. Now i am trying to do something similar, just with a TextView.
I have wrapped a TextView control and what to use it in the Xamarin forms project.
this is the wrapper:
public class MyView : TextView
{
public MyView(Context context, IAttributeSet attrs) :
base(context, attrs)
{
Initialize();
}
public MyView(Context context, IAttributeSet attrs, int defStyle) :
base(context, attrs, defStyle)
{
Initialize();
}
private void Initialize()
{
Text = "Hello World";
SetMinimumWidth(100);
SetMinimumHeight(100);
SetBackgroundColor(Android.Graphics.Color.Red);
}
}
and this is the xaml page in my xamarin forms project:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:mobile.friends"
xmlns:localimages="clr-namespace:mobile.friends.Extensions"
xmlns:androidLocal="clr-namespace:mobile.friends.Droid;assembly=mobile.friends.Android;targetPlatform=Android"
x:Class="mobile.friends.LoginPage">
<RelativeLayout>
<androidLocal:MyView x:Arguments="{x:Static androidLocal:MainActivity.Instance}" />
</RelativeLayout>
</ContentPage>
i can't find out what the problem is, i am not seeing the control on my page.


