.Net Maui Collectionview 框架存在标签问题
我想知道是否有其他人在使用最新的 .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:
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:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来向标签添加宽度请求可以显示全文。
It seems that adding a width request to the Label allowed the full text to be displayed.