代码库> 列表> 静态cell 适合“我的”界面 定义cell
静态cell 适合“我的”界面 定义cell
关注
查看次数:3632 下载次数:393
上传时间:2016-06-30 大小:120 B
这是一个自己封装的静态的cell 适合我的界面 右侧可以有开关switch label 和跳转界面

使用方法:(导入#import "CLStaticCell/CLStaticCell.h"头文件)

// 创建组
CLCommonGroup *group = [CLCommonGroup group];
[self.groups addObject:group];

//创建右侧是Label的cell
CLCommonLabel *label = [CLCommonLabel itemWithTitle:@"jsdlf"];
label.text = @"wailhfalsudjf";
label.icon = @"rightArrow";
//cell可以被点击
CLCommonLabel *label1 = [CLCommonLabel itemWithIcon:@"rightArrow" title:@"jadl;gkja" cellPressed:^{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"label cell 被点击" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
NSLog(@"label cell 被点击");

}];
label1.text = @"wailhfalsudjf";
//加入组
group.items = @[label,label1];

CLCommonGroup *group1 = [CLCommonGroup group];
[self.groups addObject:group1];
CLCommonSwitchItem *label2 = [CLCommonSwitchItem itemWithIcon:@"rightArrow" title:@"fad" valueChange:^(BOOL isOn) {
NSString *str = nil;

isOn?(str=@"打开"):(str=@"关闭");

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:str delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
NSLog(@"%@",str);
}];



group1.items = @[label2];



CLCommonGroup *group2 = [CLCommonGroup group];
[self.groups addObject:group2];

CLCommonArrowItem *label4 = [CLCommonArrowItem itemWithTitle:@"jsdlf"];
label.text = @"wailhfalsudjf";
label.icon = @"rightArrow";
label4.detailClass = [ViewController class];
CLCommonArrowItem *label5 = [CLCommonArrowItem itemWithIcon:@"rightArrow" title:@"jadl;gkja"];
label.text = @"wailhfalsudjf";
label5.detailClass = [ViewController class];
group2.items = @[label4,label5];
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0
提示
sina weixin mail 回到顶部