У меня проблема. Я хочу использовать IconView для изменения цвета изображения, поэтому я использую этот проект: https://github.com/andreinitescu/IconApp.
Теперь я добавил рендереры в IOS и Android. и я добавил класс IconView.cs в проект. В моем xaml я пытаюсь использовать следующий код:
<controls:IconView Source="ledstrip" Grid.RowSpan="2" Grid.Column="0" Margin="5" Foreground="Red" />
Но когда я запускаю свое приложение, ничего не появляется, и я понятия не имею, что я делаю неправильно? Если я создаю следующее изображение:
<Image Source="ledstrip" Grid.RowSpan="2" Grid.Column="0" Margin="5" />
Изображение будет показано!
Вот мой полный 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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:Bluepixel.Tools"
mc:Ignorable="d"
x:Class="Bluepixel.Pages.Devices">
<StackLayout Orientation="Vertical">
<ListView ItemsSource="{Binding knownDeviceList}" SelectionMode="None" RowHeight="90" ItemTapped="device_Clicked" x:Name="MyListView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.ContextActions>
<MenuItem Command="{Binding Path=BindingContext.DeleteDevice, Source={x:Reference MyListView}}}"
CommandParameter="{Binding Id}"
Text="Delete" IsDestructive="True" />
</ViewCell.ContextActions>
<AbsoluteLayout HeightRequest="70" Margin="20,10,20,10">
<StackLayout Opacity="0.3" BackgroundColor="White"
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All" />
<StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All">
<Grid RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="35" />
<RowDefinition Height="35" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="70" />
</Grid.ColumnDefinitions>
<controls:IconView Source="ledstrip" Grid.RowSpan="2" Grid.Column="0" Margin="5" Foreground="Red" />
</Grid>
</StackLayout>
</AbsoluteLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
Что я делаю не так?