Forum Xamarin Xamarin.Forms

CollectionView bug

ilia_misjurailia_misjura Member ✭✭
edited July 6 in Xamarin.Forms

Hi guys! Im using Xamarin.Forms 4.7 in my project and have issue with CollectionView.
This bug appears only on iOS and is displayed in approximately one build out of 10. I guess that bottom tabbed page causes this issue. Is there any ways to fix this?

Best Answer

  • ilia_misjurailia_misjura Member ✭✭
    Accepted Answer

    Ok, i don't know how does it works, but i fixed this by set CollectionView.HeightRequest = display height in code behind

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited July 6

    I guess that bottom tabbed page causes this issue. Is there any ways to fix this?

    Hi, what tabbed template did you use in the application? And what's the 'bug' behavior? Please post more details about that.

  • ilia_misjurailia_misjura Member ✭✭
    edited July 6

    Hi, what tabbed template did you use in the application? And what's the bug behavior? Please post more details about the that.

    I have simple XF application (not shell) and using regular tabbed page with 5 ContentPage children.
    Problem exists only on iOS.

    If it matters i'm using custom renderer to translate tabbed page icons down.

    ` public override void ViewWillLayoutSubviews()
    {
    base.ViewWillLayoutSubviews();

            if (TabBar != null)
            {
                foreach (var item in TabBar.Items)
                {
                    item.ImageInsets = new UIEdgeInsets(10, 0, -10, 0);
                }
            }
        }`
    

    On those screenshots i have mark places when collectionview displaying empty space (right now i can't catch this bug, but i'm sure it will be back:))

    Empty space appearing rare when i start my application from visual studio, after relaunching application it's ok, but this can repeat after several launches

    All my CollectionViews are wrapped with StackLayouts and placed in Grids

  • ilia_misjurailia_misjura Member ✭✭

    Upd: there it is when i delete my application from iPhone and install it again

    After relaunching its ok again

  • JarvanJarvan Member, Xamarin Team Xamurai

    On those screenshots i have mark places when collectionview displaying empty space ...

    This issue may be caused by the images caching problem in the collectionView. Try to test the related code in a contentPage directly to check that.

  • ilia_misjurailia_misjura Member ✭✭
    Accepted Answer

    Ok, i don't know how does it works, but i fixed this by set CollectionView.HeightRequest = display height in code behind

Sign In or Register to comment.