Repository navigation
Description
Description
The size of CarouselView is calculated wrong when it's nested in StackLayout. It seems like CarouselView size is constrained by page (or even screen) size instead of the parent element's size. It works well on Android. MacCatalyst is also affected.
Here is a code of a sample page demonstrating the issue:
<Grid RowDefinitions="*, *, *, *">
<Label Grid.Row="0" Text="Row 0"/>
<StackLayout Grid.Row="1">
<CarouselView x:Name="Carousel">
<CarouselView.ItemTemplate>
<DataTemplate>
<Border Margin="10" BackgroundColor="Grey">
<Label TextColor="Red" Text="{Binding .}" />
</Border>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<BoxView HeightRequest="20" Color="Purple"/>
</StackLayout>
<Label Grid.Row="2" Text="Row 2" />
<Label Grid.Row="3" Text="Row 3" />
</Grid>
I didn't test it on Windows and other platforms like Tizen/Linux.
Side note: My assumption is that the there is some problem related to ItemsView because similar bugs for CollectionView has been reported and both CollectionView and CarouselView are derived from ItemsView.
Steps to Reproduce
- Open reproduction project
- Launch the application on iOS or MacCatalyst
Link to public reproduction project repository
https://github.com/AlexeyStarkov/MAUI_CarouselView_Sizing_Issue
#12911 (comment)
Version with bug
.NET 6.0,
.NET 7.0
.NET 8.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
iOS 16.2, macOS Ventura 13.1
Did you find any workaround?
No response
Relevant log output
No response


Activity
[-][iOS, MacCatalyst] Carousel View sizing issue when nested in StackLayout[/-][+][iOS, MacCatalyst] CarouselView sizing issue when nested in StackLayout[/+]jinxinjuan commentedon Jun 8, 2023
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Can repro on iOS and Maccatalyst platform with sample project.
MAUI_CarouselView_Sizing_Issue
dotMorten commentedon Jun 25, 2023
I'm seeing the same thing - both .NET 7 and .NET 8 Preview 5. Haven't found a good way to work around this.
evgenyKozlov1996 commentedon Dec 13, 2023
The same issue verified in .NET 8.0.3
willcorum commentedon Feb 29, 2024
Same in 8.0.6. Unless you specify a height on the carousel and the data template item the carousel tries to occupy all the vertical space. Android is not affected. Setting a height doesn't allow the control to resize itself based on variable text content. Pretty frustrating. You can replicate this by removing the height settings from the HorizontalTemplateLayoutPage.xaml view in the demo. https://github.com/dotnet/maui-samples/tree/main/8.0/UserInterface/Views/CarouselViewDemos
maxiking01 commentedon Mar 6, 2024
Same on 8.0.7 . The problem only occurs on iOS. Did not test on MacCatalyst. On Android CarouselView works properly.
coop-tim commentedon Jul 1, 2024
+1 having to put fixed height on carousels because of this bug is very frustrating
dotnet-policy-service commentedon Aug 13, 2026
Hi @@AlexeyStarkov. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
dotnet-policy-service commentedon Aug 13, 2026
Hi @AlexeyStarkov. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
kubaflo commentedon Oct 10, 2026
Thank you for taking the time to report this and share the details.
We requested a check on the latest version on August 13, 2026, and there has been no subsequent human follow-up in this thread. We are closing this report as not planned at this time because the requested current-version confirmation has not arrived and we are not scheduling further investigation from this thread.
This is a backlog-prioritization decision, not evidence that the reported behavior is fixed or that the original report lacked value. If the issue remains a blocker on a supported current .NET MAUI version, please comment here with that version and the reproduction result so we can reassess it. An existing sample, attachment, code snippet, or repository test can be reused; a new repository is not required.