问题描述
我正在显示一个 GroupedList 视图,并且都启用了组标题和跳转列表.我试图隐藏组标题,但到目前为止没有运气.我想隐藏的这个属性是 GroupDisplayBinding.如果我不设置它,则会显示我的项目的默认 ToString.我只是想让它消失,作为一个常规列表,只启用跳转选项.
I'm displaying a GroupedList view, and have both enabled the group header and jumplist. I've tried to hide the Group header, but so far with no luck. This property I want to hide is GroupDisplayBinding. If I don't set it, a default of ToString for my Item is displayed. I just want it gone, as a regular list only with the jump option enabled.
一点更新:我搜索了一些示例,我想要的是一个带有索引列表的 TableView,如下所示:https://developer.xamarin.com/guides/ios/user_interface/tables/part_2_-_populating_a_table_with_data/#Adding_an_Index
A little update: I searched some samples and what I want is a TableView with and indexed list as displayed here: https://developer.xamarin.com/guides/ios/user_interface/tables/part_2_-_populating_a_table_with_data/#Adding_an_Index
最好的问候
推荐答案
Xamarin.Forms listview 允许您通过 GroupHeaderTemplate
属性为列表视图组指定自己的布局.您可以使用此布局保持标题内容为空.
Xamarin.Forms listview allows you to specify your own layout for the listview group via GroupHeaderTemplate
property. You can use this layout to keep the header content empty.
如果要在代码中定义组标题布局,则必须创建 ViewCell
的新子类并构建布局.请参阅增强 Xamarin.Forms ListView 与分组标题
If you want to define the group header layout in code you will have to create a new subclass of ViewCell
and build the layout. See an example at Enhancing Xamarin.Forms ListView with Grouping Headers
这篇关于在 Grouped ListView 中隐藏 Group header的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!