SfAccordion
will be resized properly when Accordion item’s visibility is changed in runtime.
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
this.BindingContext = this;
}
protected override void OnAppearing()
{
Device.BeginInvokeOnMainThread(() =>
{
var infoList = new List<ItemInfo>();
infoList.Add(new ItemInfo() { Name = "Cheese burger", Description = "Hamburger accompanied with melted cheese. The term itself is a portmanteau of the words cheese and hamburger. The cheese is usually sliced, then added a short time before the hamburger finishes cooking to allow it to melt." });
infoList.Add(new ItemInfo() { Name = "Veggie burger", Description = "Veggie burger, garden burger, or tofu burger uses a meat analogue, a meat substitute such as tofu, textured vegetable protein, seitan (wheat gluten), Quorn, beans, grains or an assortment of vegetables, which are ground up and formed into patties." });
infoList.Add(new ItemInfo() { Name = "Barbecue burger", Description = "Prepared with ground beef, mixed with onions and barbecue sauce, and then grilled. Once the meat has been turned once, barbecue sauce is spread on top and grilled until the sauce caramelizes." });
infoList.Add(new ItemInfo() { Name = "Chili burger", Description = "Consists of a hamburger, with the patty topped with chili con carne." });
Info = infoList;
});
base.OnAppearing();
}
… |
Hello, it is coming back again, I'm testing on IOS 14.5, XF 5.0.0.2083, Sf 19.2.0.51
and it is not appearing on IOS, I have done all the recommended steps here to solve it but with no success.
Thanks
hello it was a weird fix I set
VerticalOptions="StartAndExpand"
and that was working for android but not for IOS
the parent is a grid and the row definition was "*".
thank you very much for the example.
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<syncfusion:SfAccordion
x:Name="Accordion"
Grid.Row="0"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
BindableLayout.ItemsSource="{Binding Info}"
ExpandMode="MultipleOrNone">
<BindableLayout.ItemTemplate>
<DataTemplate>
<syncfusion:AccordionItem>
<syncfusion:AccordionItem.Header>
<Grid>
<Label Text="{Binding Name}" />
</Grid>
</syncfusion:AccordionItem.Header>
<syncfusion:AccordionItem.Content>
<Grid>
<Label Text="{Binding Description}" />
</Grid>
</syncfusion:AccordionItem.Content>
</syncfusion:AccordionItem>
</DataTemplate>
</BindableLayout.ItemTemplate>
</syncfusion:SfAccordion>
</Grid> |
Thank you very much for the response.
I reread the docs again and ended up using the same solution.