1
I’m new to mobile programming, so I wanted a help to treat an error that seems not set by the IDE (Visual Studio).
The case is that I have a screen that wanted to insert that carousel with promotional cards (something similar to the google store homepage). Here is that during the tests, the VS does not error in the code but in the compilation appears the problem.
I put an image with error print. Thank you all!
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"
x:Class="JetSolutionsApp.Views.Aba.Parceiros">
<StackLayout>
<CarouselView x:Name="slideTopo">
<CarouselView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding .}"
FontSize="50"/>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</StackLayout>
</ContentPage>
Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace JetSolutionsApp.Views.Aba
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Parceiros : ContentPage
{
public Parceiros()
{
InitializeComponent();
var nomesCarousel = new List<string>
{
"jose"," maria", "joaquim", "joão"
};
slideTopo.ItemsSource = nomesCarousel;
}
}
}
This is the mistake:
Try to use
<Label Text="{Binding}" ="50"/>
– Matheus Ribeiro