我尝试为Android发布时遇到此异常。我在构建iPhone版本时没有任何问题。
Xamarin.Forms.Xaml.XamlParseException: Position 10:5. Type convertor:NotConverter not found in xmlns clr-namespace:Comca.Helpers.Convertors;assembly=Comca.Helpers.Convertors
我试过了:
namespace:Comca;assembly=Comca.Helpers.Convertors
和此:
namespace:Comca.Helpers.Convertors;assembly=Comca
继续在此处收到错误。
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:convertor="clr-namespace:Comca.Helpers.Convertors;assembly=Comca.Helpers.Convertors"
x:Class="Comca.App">
这是班级:
using System;
using System.Globalization;
using Xamarin.Forms;
namespace Comca.Helpers.Convertors
{
public class NotConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return !(bool)value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return !(bool)value;
}
}
}
我完全迷失了。 谢谢你的帮助。