TableView实现Switch的方法
直接修改accessoryView即可。
CellForRow方法里写:
CellForRow方法里写:
UISwitch *switch=[[UISwitch alloc]init];
[switch addTarget:self action:@selector(switchValueChange:) forControlEvents:UIControlEventValueChanged];
cell.accessoryView=switch;
评论
发表评论