Xamarin.forms Xamarin 2.3.3.193和ItemTemplate

Xamarin.forms Xamarin 2.3.3.193和ItemTemplate,xamarin.forms,itemtemplate,Xamarin.forms,Itemtemplate,我已经在我的Xamarin项目中更新了Xamarin表单。现在这段代码不再工作了 var view=(view)ItemTemplate.CreateContent(); 如果(视图!=null){ var bindableObject=作为bindableObject查看; if(bindableObject!=null) bindableObject.BindingContext=newItem; _imageStack.Children.Add(视图); } 问题是(查看)ItemTem

我已经在我的Xamarin项目中更新了Xamarin表单。现在这段代码不再工作了

var view=(view)ItemTemplate.CreateContent();
如果(视图!=null){
var bindableObject=作为bindableObject查看;
if(bindableObject!=null)
bindableObject.BindingContext=newItem;
_imageStack.Children.Add(视图);
}
问题是
(查看)ItemTemplate。CreateContent()
出错:

消息: 无法解析元素上的名称

来源:Xamarin.Forms.Xaml

堆栈: 位于Xamarin.Forms.Xaml.ReferenceExtension.ProvideValue 中的(System.IServiceProvider服务提供程序)[0x000b6] [……]

在调试窗口中,我可以看到以下信息

02-20 17:44:04.450 I/art     (13331): Starting a blocking GC Explicit
02-20 17:44:04.482 I/art     (13331): Explicit concurrent mark sweep GC freed 436(24KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 14MB/18MB, paused 762us total 31.310ms
02-20 17:44:04.482 I/System  (13331): FinalizerDaemon: finalize objects = 48
02-20 17:44:04.484 D/Mono    (13331): GC_TAR_BRIDGE bridges 20 objects 20 opaque 0 colors 20 colors-bridged 20 colors-visible 20 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.11ms tarjan 0.06ms scc-setup 0.08ms gather-xref 0.00ms xref-setup 0.00ms cleanup 0.30ms
02-20 17:44:04.484 D/Mono    (13331): GC_BRIDGE: Complete, was running for 34.10ms
02-20 17:44:04.484 D/Mono    (13331): GC_MINOR: (Nursery full) time 4.22ms, stw 4.53ms promoted 32K major size: 3504K in use: 2748K los size: 6404K in use: 5406K

My函数以
ImageSource
格式、字节[]和该图像的字节长度将图像保存在内存中。

这表示正在加载的
XAML
包含
{x:Reference foo}
标记扩展,并且在运行时,没有使用
x:Name=“foo”定义的元素在层次结构中找到了


如果没有看到您的
XAML
,就无法判断问题是否存在于您的代码中,或者是
Xamarin.Forms中的错误。这表明您正在加载的
XAML
包含
{x:Reference foo}
标记扩展,并且在运行时,没有使用
x:Name=“foo”定义的元素在层次结构中找到了


如果看不到您的
XAML
,就无法确定问题是在您的代码中,还是在
Xamarin.Forms

谢谢,我知道在哪里可以搜索我的错误。谢谢,我知道在哪里可以搜索我的错误。