gpt4 book ai didi

listview - 如何在 ListView 的 TextCell 中包装文本?

转载 作者:行者123 更新时间:2023-12-03 19:54:11 24 4
gpt4 key购买 nike

如何在 ListView 的 TextCell 中包装文本?我试过设置 HasUnevenRowsTrue但这没有帮助。

最佳答案

您不能使用 Xamarin 的“开箱即用”TextCell 功能。但是,您应该能够创建一个 ViewCell 并利用 LineBreakMode Label 的属性来完成自动换行。可能是这样的:

<ListView>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Label Text="My TextCell Text" LineBreakMode="WordWrap"/>
<Label Text="My TextCell Detail" LineBreakMode="WordWrap"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

关于listview - 如何在 ListView 的 TextCell 中包装文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38735447/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com