alexrainman / CarouselView

CarouselView control for Xamarin Forms
MIT License
436 stars 176 forks source link

Navigation Page Problem #509

Closed AhmedAdelGadElkareeem closed 5 years ago

AhmedAdelGadElkareeem commented 5 years ago

the CarouselView appear for the first time i call the page and if go to another page and return to the page containing CarouselView , the CarouselView not appear -- Calling CarouselViewRenderer.Init() in MinActivity.cs

jvhgamer commented 5 years ago

To help clarify for @AhmedAdelGadElkareeem, the CarouselViewControl loads correctly on ContentPage appearing. However if the page is removed, added again, and "reappeared" - the CarouselViewControl disappears. Tried ensuring Opacity, InputTransparent, IsEnabled are all true, and they are. ItemsSource shows it is working as well.

Problem originates, for me at least, in using a CarouselPage on Android and implementing page switching via only having one Child added at a time (to remove swipe gesture between pages).

Essentially if the page with the carouselViewControl is removed, if it is added back again the control disappears and cannot be interacted with.

DominicV21 commented 5 years ago

I have a similar problem,

I have a tabbed page with 5 pages. Tab 1 contains the carouselview. Initially it works just fine.

when i add the carouselview to tab 3 it stays fine all the way

Only happends on Android.

DominicV21 commented 5 years ago

Related to #481 #465 #388 Which should be fixed?

Nullstr1ng commented 5 years ago

Hi Alex, it's Xamarin 4.0 now, and I this issue still exists. Not sure what the possible solution is. So I headed over to this issue tab and tried reporting but it seems that there are already reports regarding this issue.

Basically, the problem is, I have a Shell, and one of the pages is using your control. CarouselView shows on first launch without a problem, going to other tab and then going back to the page where the CarouselView is. The control doesn't show up anymore. I added a background color to CarouselView just to know what could be the issue, so I set the CarouselView's background to Red, run the app, now the app has a red background with the Carousel view pages, and then navigated to another page, and then going back. So this time, the pages where gone, but the red background is still there.

So I think the carousel view pages were removed and was not able to add them back .

alexrainman commented 5 years ago

I am back! Releasing new version in the next 2 weeks. This issue will be corrected.

Nullstr1ng commented 5 years ago

@alexrainman > I am using Xamarin 4.0 Shell and the CarouselView version is 5.2.0. When I downgraded to 5.0.2, the bug is gone. I can just go back and forth to different pages with CarouselView in it, without any issues

pandaloupe commented 5 years ago

While waiting for the update of this great control (I still wonder why it is not part of the Xamarin core yet) and also struggling with the ViewPageIndicator reference error, I found a quick and dirty workaround by clearing the content of the page before changing the main page.

        public static void OpenPage(Page page)
        {
            // Workaround for Carousel Bug
            var oldPage = Application.Current.MainPage;
            if (oldPage is NavigationPage navPage)
            {
                if (navPage.RootPage is ContentPage contentPage)
                {
                    contentPage.Content = null;
                }
            }

            Application.Current.MainPage = page;
        }

This leaves the current page blank for a moment, while the new page is being initialized, but at least the exception is gone... ;-)

alexrainman commented 5 years ago

Community, i have been working hard to release a new version. I am close to that point.

alexrainman commented 5 years ago

This issue and #481 #465 #388 which are related, will be corrected in the next release.

GreenDaniel commented 4 years ago

@alexrainman > I am using Xamarin 4.0 Shell and the CarouselView version is 5.2.0. When I downgraded to 5.0.2, the bug is gone. I can just go back and forth to different pages with CarouselView in it, without any issues

You saved my life. I still hope this will be fixed soon!

jaysonragasa commented 4 years ago

@alexrainman > I am using Xamarin 4.0 Shell and the CarouselView version is 5.2.0. When I downgraded to 5.0.2, the bug is gone. I can just go back and forth to different pages with CarouselView in it, without any issues

You saved my life. I still hope this will be fixed soon!

5.0.2 is the "Stable" version

hamzaoubouzid commented 2 years ago

i have same probleme i using '' xamarin form 5.0.0.2196 '' and '' CarouselView version is 5.2.0'' when i open page 1 as start page the CarouselView it works countaine items but when i switch to Page 2 and go back to page 1 it be null (Empty)

Ley00 commented 2 years ago

I still have this same problem and I noticed that when I change the size of the carousel after changing the page the view came back, so I put the carousel inside a stacklayout and gave it a name. So every time there is a page change it will change the size making the carousel appear again on android.

    protected async override void OnAppearing()
    {
        base.OnAppearing();
        if (StackDados.HeightRequest == 140)
        {
            StackDados.HeightRequest += 1;
        }
        else StackDados.HeightRequest -= 1;
   }