XF 列表视图分组列表填充
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
{
new State("FL")
{
new City{ Name="beijing" },
new City{ Name="shanghai"}
},
new State("AL")
{
new City{ Name="guangzhou"},
new City{ Name="shenzhen"},
}
};
var dataTemplate = new DataTemplate(typeof(TextCell));
dataTemplate.SetBinding(TextCell.TextProperty, "Name");
myListView.IsGroupingEnabled = true;
myListView.GroupDisplayBinding = new Binding("Name");
myListView.GroupShortNameBinding = new Binding("Name");
//myListView.RowHeight = 100;
myListView.Header = "这是页眉";
myListView.Footer = "这是页脚";
myListView.SeparatorVisibility = SeparatorVisibility.Default;//在windows phone里面默认没有分割线,在android和Ios才有
myListView.SeparatorColor = Color.Red;
myListView.ItemTemplate = dataTemplate;
myListView.ItemsSource = states;
}
}
}
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
{
public class City
{
public string Name { get; set; }
}
{
public State(string name)
{
Name = name;
}
public string Name { get; set; }
}
}
XF 列表视图分组列表填充的更多相关文章
- Apply Grouping to List View Data 将分组应用于列表视图数据
This lesson will teach you how to apply grouping to List View data. For this purpose, you will group ...
- Android 用SQLite 使用 CursorLoader 中的数据填充列表视图
我做了简单的测试应用程序基于此示例.有一个按钮,插入到数据库和列表视图的数据.都是在 MainActivity 中.在原来的代码是restartLoader() 仅从调用 onResume() ,但它 ...
- SharePoint 2013无代码实现列表视图的时间段动态筛选
本文介绍两种为列表视图设置时间段筛选器的方法.其中,第一个方法用于SharePoint Server,第二个方法同时还能用于SharePoint Foundation. 方法一:日期筛选器Web部件 ...
- [WP8.1UI控件编程]SemanticZoom控件实现分组列表
11.1.5 SemanticZoom实现分组列表 SemanticZoom控件可以让用户实现一种更加高级的列表,这种列表可以对列表的项目进行分组,同时这个SemanticZoom控件会提供两个具有相 ...
- Android ExpandableListView BaseExpandableListAdapter (类似QQ分组列表)
分组列表视图(ExpandableListView) 和ListView不同的是它是一个两级的滚动列表视图,每一个组可以展开,显示一些子项,类似于QQ列表,这些项目来至于ExpandableListA ...
- delphi列表视图组件(TListView)使用方法|实例
TListView 组件以多种形式显示列表的项目,如详细资料.小图标.大图标等形式表示列表中的项目. 列表视图与用TListBox 组件实现的列表框非常相似.不同的是,列表视图可以让用户选择不同 ...
- Swift - 使用表格组件(UITableView)实现分组列表
1,样例说明: (1)列表以分组的形式展示 (2)同时还自定义分区的头部和尾部 (3)点击列表项会弹出消息框显示该项信息. 2,效果图: 3,代码如下: 1 2 3 4 5 6 7 8 9 ...
- Change Field Layout and Visibility in a List View 在列表视图中更改字段布局和可见性
This lesson will guide you through the steps needed to select columns displayed in the List View. Fo ...
- SwiftUI - 一起来仿写微信APP之一首页列表视图
简介 最近在学习 SwiftUI ,我一般都是先去学习界面布局,所以就想着仿写一下经常使用的软件的界面,所以先拿微信开刀.因为不想一次性发太多的内容,所以只好将主题分解,一部分一部分地去讲,接下来我们 ...
随机推荐
- iOS开发:父子控制器简介:
#import "ViewController.h" #import "ScoietyViewController.h" #import "HotVi ...
- 修改QList中的item(使用下标([index])才可以获得可修改的item的引用)
QList算是最常用的集合了,今儿偶然间需要修改QList中的值,结果郁闷了.QList中提供了replace函数来替换item,但不是修改.而at().value()操作均返回的是const的ite ...
- NET WinForm 开发所见即所得的 IDE 开发环境
Github 开源:使用 .NET WinForm 开发所见即所得的 IDE 开发环境(Sheng.Winform.IDE)[2.源代码简要说明] GitHub:https://github.co ...
- 为什么 qt 成为 c++ 界面编程的第一选择?
为什么qt成为c++界面编程的第一选择 一.前言 为什么现在QT越来越成为界面编程的第一选择,笔者从事qt界面编程已经有接近8年,在这之前我做C++界面都是基于MFC,也做过5年左右.当时为什么会从M ...
- vs 2013 常用快捷键及常见问题的解决
1. 代码编辑 关闭当前文档:ctrl + F4 打开光标所在位置的文档:ctrl + G(shift + g) 返回上次编辑的位置:ctrl + -(键盘数字键 0 后的那个按键) 移动光标所在的行 ...
- 【42.86%】【codeforces 742D】Arpa's weak amphitheater and Mehrdad's valuable Hoses
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- 【76.83%】【codeforces 554A】Kyoya and Photobooks
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- [React] Pass Data To Event Handlers with Partial Function Application
In this lesson we’ll see how to pass an item’s id value in an event handler and get the state to ref ...
- arm-linux内存管理学习笔记(1)-内存页表的硬件原理
linux kernel集中了世界顶尖程序猿们的编程智慧,犹记操作系统课上老师讲操作系统的四大功能:进程调度 内存管理 设备驱动 网络.从事嵌入式软件开发工作,对设备驱动和网络接触的比較多. 而进程调 ...
- [Ramda] Pick and Omit Properties from Objects Using Ramda
Sometimes you just need a subset of an object. In this lesson, we'll cover how you can accomplish th ...