Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] CarouselView (and IndicatorView) are layouted unpredicatable in vertical StackLayout #14346

Open
thisismyself opened this issue Jun 10, 2021 · 2 comments
Labels
a/carouselview p/iOS 🍎 s/unverified New report that has yet to be verified t/bug 🐛

Comments

@thisismyself
Copy link

Description

Easiest to understand is seeing the screenshots. The CarouselView is not aligned predictable, it may vary in vertical alignment. In real world app, I loose many space for information.

Steps to Reproduce

  1. Get the CarouselView Demo from Xamarin github, branch main, comitt dff32ef (URL https://github.com/xamarin/xamarin-forms-samples/tree/main/UserInterface/CarouselViewDemos)
  2. Compile and run solution on physical iPhone (not tested on Simulator)
  3. Scroll down to the example for "Indicators"
  4. Open the page with indicators. It will be shown one way or another. When you repeatedly close and open the app, you will see the vertical alignment of the carousel view and the indicator view can vary. In my real world app I am loosing very much space for information when the carousel view is shrinked, having a large empty space at the moment.
  5. I also observed this issue in my real world app when I removed the IndicatorView.

Expected Behavior

Appearance is always the same.

Actual Behavior

Appearance is not always the same.

Basic Information

  • Version with issue:
  • Last known good version: n/a
  • Platform Target Frameworks:
    • iOS: 14.6 / XCode 12.5
    • Android: no issue in any version
    • UWP: not tested
  • NuGet Packages: Xamarin.Forms 4.8.1821 - 5.0.2012
  • Affected Devices:
    iPhone 7 iOS 14.6, iPhone 8 14.6, a more recent iPhone, exact model not known at the moment

Environment

VS 16.10.0
Xamarin.iOS 14.20.0.1

Screenshots

Screenshot1
Screenshot2

Reproduction Link

https://github.com/xamarin/xamarin-forms-samples/tree/main/UserInterface/CarouselViewDemos

Workaround

no Workaround

@thisismyself
Copy link
Author

thisismyself commented Jun 17, 2021

The issue also happens when the CarouselView is used without an IndicatorView. And it might be related to another issue, where the CarouselView is consuming to much space. #8640

@caleb523
Copy link

Is this only occurring on physical devices for you? In my experience with this issue, whether or not it takes up the full space or ~half is determined by whether the iOS device is held vertically or horizontally. My application is locked to portrait orientation only but, if the user has the device rotated past a certain threshold when the page loads, the CarouselView will only occupy about half of the vertical space - the same amount that it would be allotted in a landscape orientation. Strangely, this behavior only occurs when the CarouselView is the child of a StackLayout or Grid. If the CarouselView is the direct child of ContentView.Content, this issue does not occur at all. So my hypothesis would be that either something in the CarouselView or the Layout is somehow ignoring the orientation of the application and is instead using the physical orientation of the device to determine the height. I'm planning on switching to CardView for my project however.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/carouselview p/iOS 🍎 s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

3 participants