.Net Maui Collectionview 框架存在标签问题

发布于 2025-01-12 22:13:26 字数 1239 浏览 3 评论 0原文

我想知道是否有其他人在使用最新的 .Net maui 预览版(版本 17.2.0 预览版 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>

它显示我的倒计时秒数并每秒更新。结果: 输入图片此处描述

您可以看到屏幕边缘及其被切断的位置。 以下是删除框架时仅在数据模板中留下堆栈布局的示例: 输入图片此处描述

编辑: 它似乎不仅仅适用于框架,但是当我在集合视图中的堆栈布局内部有一个堆栈布局时,它似乎会产生类似的结果。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谈情不如逗狗 2025-01-19 22:13:26

看来向标签添加宽度请求可以显示全文。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文