Search code examples
labelframepreviewcollectionviewmaui

.Net Maui Collectionview frame with label issue


I was wondering if anyone else is experiencing this issue with the latest .Net maui preview(Version 17.2.0 Preview 1.0)

<CollectionView ItemsSource="{Binding EventList}" x:Name="Events_CollectionView" ItemsLayout="VerticalList"  SelectionMode="Single">
                <CollectionView.ItemTemplate>
                    <DataTemplate>
                            <Frame>
                                        <StackLayout Margin="0,0,0,0">
                                            <Label Text="{Binding Seconds}" FontSize="35" FontAttributes="Bold" TextColor="White" HorizontalOptions="End"/>
                                        </StackLayout>
                            </Frame>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>

This displays the seconds of my countdown and gets updated every second. The result: enter image description here

You can see the edge of the screen and where it gets cut off. Here is an example when the frame is removed leaving just the stack layout in the data template: enter image description here

Edit: It appears not to just apply to frames but when I have a stacklayout inside of a stacklayout in the collectionview it appears to produce a similar result.


Solution

  • It seems that adding a width request to the Label allowed the full text to be displayed.