ios_UI

XLForm的基本用法

2016-04-25  本文已影响2027人  makemake

XLForm在这种表单填写的情况下非常好用:

Paste_Image.png

不需要管理键盘是否遮挡界面非常实用。代码如下:

XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;

form = [XLFormDescriptor formDescriptor];
section = [XLFormSectionDescriptor formSection];
[form addFormSection:section];

// 家长姓名
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"ParentName" rowType:XLFormRowDescriptorTypeText title:@"姓名:"];
[row.cellConfig setObject:[UIFont systemFontOfSize:15] forKey:@"textLabel.font"];
[section addFormRow:row];

// 学校名
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"SchoolName" rowType:XLFormRowDescriptorTypeText title:@"学校名:"];
[row.cellConfig setObject:[UIFont systemFontOfSize:15] forKey:@"textLabel.font"];
[section addFormRow:row];

// 学号
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"StudentNum" rowType:XLFormRowDescriptorTypeInteger title:@"学号:"];
[row.cellConfig setObject:[UIFont systemFontOfSize:15] forKey:@"textLabel.font"];
[section addFormRow:row];

self.form = form;
上一篇 下一篇

猜你喜欢

热点阅读