【问题标题】:How to show all the content of list view row如何显示列表视图行的所有内容
【发布时间】:2019-11-22 03:04:16
【问题描述】:

我正在使用 Xamarin 表单来制作跨平台 APP。

我正在使用列表视图,但我不知道如何让一行显示它的全部内容

我尝试添加 HasUnevenRows="True" 但没有成功。我也尝试修复 RowHeight="100"

谁能帮帮我。

【问题讨论】:

  • 当 HasUnevenRows 为 false 时,您是否尝试过 RowHeight="100"
  • 您似乎已将LineBreakMode 设置为TailTruncation
  • 改变的 LineBreakMode 还是一样的,是的,我试过 HasUnevenRows 是假的

标签: c# xaml listview xamarin.forms cross-platform


【解决方案1】:
<ListView RowHeight="100" x:Name="ContextDemoList">
  <ListView.ItemTemplate>
    <DataTemplate>
      <ViewCell>
         <StackLayout Padding="5">
              <Label VerticalOptions="CenterAndExpand" Text="{Binding title}" />
         </StackLayout>
      </ViewCell>
         </DataTemplate>
       </ListView.ItemTemplate>
     </ListView>

【讨论】:

  • 我的项目源是 ObservableCollection,所以我必须将您的代码添加到我的列表视图并将其更改为 Text="{Binding}"。感谢您的帮助
猜你喜欢
  • 1970-01-01
  • 2012-08-28
  • 1970-01-01
  • 2020-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多