that is to all, I am trying to create a small app that should have the following layout in xmal but when from code I go to add the content to the item of the tabview unfortunately I do not spit anything, instead if I change the xaml layout and delete the pickers the contents tabview is updated correctly. I enclose some code so I make everything clearer.
<ContentPage.Content>
<StackLayout x:Name="stackMadre" >
<Picker x:Name="picTipoServizio" ItemsSource="{StaticResource Servizi}"
SelectedIndexChanged="picTipoServizio_SelectedIndexChanged" >
</Picker>
<ScrollView x:Name="scrollView" Orientation="Vertical">
<tabView:SfTabView x:Name="tabView" TabItemTapped="TabView_TabItemTapped"
SelectionChanged="SfTabView_SelectionChanged" >
</tabView:SfTabView>
</ScrollView>
</StackLayout>
</ContentPage.Content>
and on my code c#
// first function for create the tab item
private void CreateDayTab()
{
for (int i = 0; i < 60; i++)
{
var data1 = today.AddDays(i).ToString("ddd dd MMM", culture);
tabView.Items.Add(new SfTabItem(){ Title = data1 }) ;
}
}
// then i have this function for creare the content of item dynamics
// this content return a grid with dynamic element
public async Task<Grid> GridComposionAsync()
{ return grid }
// and then the event
public async void SfTabView_SelectionChanged(object sender, Syncfusion.XForms.TabView.SelectionChangedEventArgs e)
{
_titleTabItem = tabView.Items[e.Index].Title;
tabView.Items[e.Index].Content = await GridComposionAsync();
}
public async void TabView_TabItemTapped(object sender, TabItemTappedEventArgs e)
{
_titleTabItem = e.TabItem.Title;
e.TabItem.Content = await GridComposionAsync();
}
doing the necessary tests I am sure that the grid is created correctly because precisely by removing the picker from the xaml or setting the content of the conte page as sftabview everything works correctly, but I need to make it appear in this stacklyout could someone help me?
<ScrollView x:Name="scrollView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Orientation="Vertical">
<tabView:SfTabView x:Name="tabView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" TabItemTapped="TabView_TabItemTapped"
SelectionChanged="SfTabView_SelectionChanged" >
</tabView:SfTabView>
</ScrollView> |
great function but I have another problem, for the first tab it's ok but for the second tab I have this problem,
the grid is not formed correctly. look the screen.