我在 Xamarin 中创建了自己的自定义渲染器,如下所示:
namespace TestApp
{
public class CustomEntry : Entry
{
public CustomEntry ()
{
}
}
}
如何将它包含在我的 HomePage.xaml 文件中?我试过这个:
<?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:TestApp;assembly:TestApp"
x:Class="TestApp.SubPage">
<ContentPage.Content>
<StackLayout>
<local:CustomEntry></local:CustomEntry>
</StackLayout>
</ContentPage.Content>
</ContentPage>
但它不起作用,说 CustomEntry 不是“ http://xamarin.com/schemas/2014/forms ”命名空间中的有效控件。有任何想法吗?