摘要:
1、自定义控件 1.1 CHDataView.h #import <Foundation/Foundation.h> @interface CHDataView : UIView /** 数据模型 */ @property (nonatomic, strong) CHDataItem *dataIt 阅读全文
posted @ 2018-08-05 12:52
CH520
阅读(465)
评论(0)
推荐(0)
摘要:
1、系统方式 将要删除的数据添加到待删数组中,从数据源中删除待删数组中包含的数据,刷新表格。 OC 中可设置编辑模式为 UITableViewCellEditingStyleDelete | UITableViewCellEditingStyleInsert; 或者设置 tableView.allo 阅读全文
posted @ 2018-08-05 12:51
CH520
阅读(928)
评论(0)
推荐(0)
摘要:
1、创建 1.1 BookCell.h @class BookModel; @interface BookCell : UITableViewCell // 定义 Cell 的数据模型 @property(nonatomic, strong) BookModel *book; @end 1.2 Bo 阅读全文
posted @ 2018-08-05 12:51
CH520
阅读(239)
评论(0)
推荐(0)
摘要:
1、自定义非等高 Cell介绍 1.1 代码自定义(frame) 新建一个继承自 UITableViewCell 的类。 重写 initWithStyle:reuseIdentifier: 方法。 添加所有需要显示的子控件(不需要设置子控件的数据和 frame, 子控件要添加到 contentVie 阅读全文
posted @ 2018-08-05 12:51
CH520
阅读(230)
评论(0)
推荐(0)
摘要:
1、创建索引条 // UITableViewDataSource 协议方法 - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { // 索引条数据源数组初始化,实例化索引条上的字符存放的数组对象 NSMutabl 阅读全文
posted @ 2018-08-05 12:51
CH520
阅读(462)
评论(0)
推荐(0)
摘要:
1、XMGMessage.h #import <UIKit/UIKit.h> typedef enum { XMGMessageTypeMe = 0, XMGMessageTypeOther = 1 } XMGMessageType; @interface XMGMessage : NSObject 阅读全文
posted @ 2018-08-05 12:51
CH520
阅读(344)
评论(0)
推荐(0)
摘要:
在 iOS 8.0 以上版本中, 我们可以使用 UISearchController 来非常方便地在 UITableView 中添加搜索框. 而在之前版本中, 我们还是必须使用 UISearchDisplayController + UISearchBar 的组合方式。 我们创建的 tableVie 阅读全文
posted @ 2018-08-05 12:51
CH520
阅读(446)
评论(0)
推荐(0)
摘要:
通过改变分段的行数实现分段的折叠与打开。分段处于折叠状态时,设置分段的行数为 0。 1、分段折叠状态数组初始化 // 声明记录折叠状态数组 @property(nonatomic, retain)NSMutableArray *foldStatusArray; // 初始化记录折叠状态数组 fold 阅读全文
posted @ 2018-08-05 12:50
CH520
阅读(352)
评论(0)
推荐(0)
摘要:
需遵守协议 UITableViewDataSource, UITableViewDelegate,并设置代理 UITableViewDelegate 继承自 UIScrollViewDelegate @protocol UITableViewDelegate<NSObject, UIScrollVi 阅读全文
posted @ 2018-08-05 12:50
CH520
阅读(404)
评论(0)
推荐(0)
摘要:
1、设置表格编辑开关状态 // 设置表格的编辑状态 tableView.editing = YES; // 翻转表格的编辑状态 tableView.editing = !tableView.editing; // 带动画翻转表格的编辑状态 [tableView setEditing:!tableVi 阅读全文
posted @ 2018-08-05 12:50
CH520
阅读(278)
评论(0)
推荐(0)

浙公网安备 33010602011771号