nic*_*cks 2 listview xamarin xamarin.forms
如何在ListView的TextCell中包装文字?我尝试设置HasUnevenRows为,True但这无济于事。
您无法使用Xamarin的“开箱即用” TextCell功能。但是,您应该能够创建ViewCell并利用Label 的LineBreakMode属性完成自动换行。大概是这样的:
<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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3425 次 |
| 最近记录: |