I'm doing an app in Xamarin Forms, using the nuous Carousel View, I'm trying, and it works perfectly for me in Android, the carousel is already shown, but if it is not shown, I installed the Nuget in the shared project, in the android project and in the ios project, I can not find a solution to the problem, I hope someone can help me.
Here, I initialized the carousel in the ios app
using CarouselView.FormsPlugin.iOS;
namespace FortiaApp.iOS
{
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
RoundedBoxViewRenderer.Init();
AnimationViewRenderer.Init();
CarouselViewRenderer.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
}
and here the code of the shared project
private View[] _views;
public frmDetalle(int idUsuario)
{
InitializeComponent();
this.idUsuario = idUsuario;
lblSaludo.Text = utileriasServices.getSaludo();
lblFecha.Text = utileriasServices.getFecha();
Device.BeginInvokeOnMainThread(async () =>
{
var response = await fortiaServices.PostAsinc<AccountModel>(new Account { IdUser = this.idUsuario }, "/GetInfoInit");
if (response != null)
{
this.accountModel = response;
Device.BeginInvokeOnMainThread(async () =>
{
var responseToken = await fortiaServices.PostAsinc<TokenApiResponse>(new Object(), "/GetToken");
if (responseToken != null)
{
this.accountModel.tokenApi = responseToken;
this.accountModel.idTarjeta = this.accountModel.account.idTarjetaPrincipal;
//Agrega tarjetas
_views = new View[accountModel.Tarjetas.Count + 1];
_views[0] = new frmTarjeta(this.accountModel, this.accountModel.idTarjeta);
for (var i = 0; i < accountModel.Tarjetas.Count; i++)
{
this.accountModel.idTarjeta = this.accountModel.Tarjetas[i].IdTarjeta;
_views[i + 1] = new frmTarjeta(this.accountModel, this.accountModel.Tarjetas[i].IdTarjeta);
}
Carousel.ItemsSource = _views;
await GetInfoPrincipal();
}
else
{
await DisplayAlert("Tenemos problemas", "Los servicios no estan disponibles", "Continuar");
await Navigation.PushAsync(new frmLogin());
}
});
await Navigation.PopModalAsync(false);
}
else
{
await Navigation.PopModalAsync(false);
await DisplayAlert("Tenemos problemas", "Los servicios no estan disponibles", "Continuar");
await Navigation.PushAsync(new frmLogin());
}
});
}
Here I show the output on the two platforms