diff --git a/Setting/Setting/Base.lproj/LaunchScreen.storyboard b/Setting/Setting/Base.lproj/LaunchScreen.storyboard index 9b4366c..97842a3 100644 --- a/Setting/Setting/Base.lproj/LaunchScreen.storyboard +++ b/Setting/Setting/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,12 @@ - - + + + + + - + + + @@ -13,18 +18,17 @@ - + - - + diff --git a/ZFSetting/View/ZFSettingCell.m b/ZFSetting/View/ZFSettingCell.m index c09e068..d578899 100755 --- a/ZFSetting/View/ZFSettingCell.m +++ b/ZFSetting/View/ZFSettingCell.m @@ -42,27 +42,24 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus - (void)setItem:(ZFSettingItem *)item { _item = item; // 设置数据 - self.imageView.image = item.icon.length ? [UIImage imageNamed:item.icon] : nil; + self.imageView.image = item.icon.length ? [UIImage imageNamed:item.icon] : nil; self.textLabel.text = item.title; - if (item.type == ZFSettingItemTypeArrow) { - self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - // 用默认的选中样式 - self.selectionStyle = UITableViewCellSelectionStyleBlue; - } else if (item.type == ZFSettingItemTypeSwitch) { + if (item.type == ZFSettingItemTypeSwitch) { if (_switch == nil) { _switch = [[UISwitch alloc] init]; _switch.on = item.switchOn; [_switch addTarget:self action:@selector(switchStatusChanged:) forControlEvents:UIControlEventValueChanged]; - } else { - [_switch setOn:item.switchOn animated:YES]; - } + } else { + [_switch setOn:item.switchOn animated:YES]; + } // 右边显示开关 self.accessoryView = _switch; // 禁止选中 self.selectionStyle = UITableViewCellSelectionStyleNone; } else { - // 什么也没有,清空右边显示的view self.accessoryView = nil; + self.accessoryType = item.type == ZFSettingItemTypeArrow ? + UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone; // 用默认的选中样式 self.selectionStyle = UITableViewCellSelectionStyleBlue; }