静态cell 适合“我的”界面 定义cell
这是一个自己封装的静态的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];
下载地址:http://www.wenjiangs.com/wp-content/uploads/2021/docimg35/cb5172e0734a82cafef16af6c3bc913b.zip
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论