From f77ab6ad808c0fe77984bde9f2f96421230fa02a Mon Sep 17 00:00:00 2001 From: bqlin Date: Sun, 1 Apr 2018 18:07:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20ZFSettingItemTypeArrow?= =?UTF-8?q?=20=E7=B1=BB=E5=9E=8B=20cell=20=E5=88=B7=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8A=8A=E4=B8=8A=E4=B8=80=E6=AC=A1=E7=9A=84?= =?UTF-8?q?=20accessoryView=20=E6=B8=85=E7=A9=BA=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZFSetting/View/ZFSettingCell.m | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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; } From 8e89ecee7c726fc6403406c02c9e4b3856824538 Mon Sep 17 00:00:00 2001 From: bqlin Date: Fri, 6 Apr 2018 09:28:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E6=A1=88=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setting/Base.lproj/LaunchScreen.storyboard | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 @@ - + - - +