首页 > 解决方案 > 无法将元素添加到页面 (IOS) xaml、gif 图像

问题描述

您好我正在尝试在 XAML 中使用 FFImageloader 包。我在设备上的 appdelegate 和 mainacticivy 中添加了自定义渲染。当它呈现我的页面时,它会引发错误。

我试图从新的命名空间中删除属性,它仍然会抛出这个错误。我已经添加了命名空间并从他们的 github 页面上的指南中安装了以下包。

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage 
     xmlns="http://xamarin.com/schemas/2014/forms" 
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ODEON.Pages.news"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
Title="MainWindow">
<ContentPage.Content>
    <ffimageloading:CachedImage HorizontalOptions="Center" VerticalOptions="Center"
        WidthRequest="300" HeightRequest="300"
        DownsampleToViewSize="true"
        Source = "http://loremflickr.com/600/600/nature?filename=simple.jpg">
    </ffimageloading:CachedImage>
    <ListView x:Name="listView">
        <ListView.ItemTemplate>
          <DataTemplate>
            <TextCell Text="{Binding title.rendered}" />
          </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</ContentPage.Content>

这是错误:

ODEON/Pages/news.xaml(10,10): Error: Position 9:10. Can not Add() elements to ODEON.Pages.news.Content (ODEON.iOS)

标签: xamlxamarinxamarin.formsffimageloading

解决方案


推荐阅读