使用控制我Xamarin創建自己的自定義渲染器,看起來像這樣:XamarinForms:從自定義呈現在XAML
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」命名空間的有效控制。有任何想法嗎?
完成它,但我得到一個錯誤,說「System.ArgumentNullException:參數不能爲null參數名稱:AssemblyName」。仍試圖找出原因。更新我的代碼示例 –