Skip to content

Commit

Permalink
优化标题为空时的效果
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo committed Nov 22, 2016
1 parent e7e88e1 commit 8b03463
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LCActionSheet.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LCActionSheet"
s.version = "2.6.0"
s.version = "2.6.1"
s.summary = "A simple, ornamental, but powerful action sheet! Support: http://LeoDev.me"
s.homepage = "https://github.com/iTofu/LCActionSheet"
s.license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion LCActionSheet/LCActionSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// GitHub: http://github.com/iTofu
// Mail: mailto:devtip@163.com
//
// V 2.6.0
// V 2.6.1

#import <UIKit/UIKit.h>

Expand Down
8 changes: 8 additions & 0 deletions LCActionSheet/LCActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ @interface LCActionSheet () <UITableViewDataSource, UITableViewDelegate, UIScrol

@property (nonatomic, weak) UIView *whiteBgView;

@property (nonatomic, weak) UIView *lineView;

@end

@implementation LCActionSheet
Expand Down Expand Up @@ -275,6 +277,10 @@ - (void)setupView {
make.bottom.equalTo(tableView.mas_top);
make.height.equalTo(@1);
}];
self.lineView = lineView;

self.lineView.hidden = !self.title || self.title.length == 0;


UIView *divisionView = [[UIView alloc] init];
divisionView.alpha = 0.1f;
Expand Down Expand Up @@ -377,6 +383,8 @@ - (void)setTitle:(NSString *)title {
[self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.titleLabel.mas_bottom).offset(self.title.length > 0 ? 14.0f : 0);
}];

self.lineView.hidden = !self.title || self.title.length == 0;
}

- (void)setCancelButtonTitle:(NSString *)cancelButtonTitle {
Expand Down
2 changes: 2 additions & 0 deletions LCActionSheetDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = LCActionSheetDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -626,6 +627,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = LCActionSheetDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
2 changes: 1 addition & 1 deletion LCActionSheetDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.6.0</string>
<string>2.6.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ In me the tiger sniffs the rose.

## 版本 ChangeLog


### V 2.6.1 (2016.11.22)

* 优化标题为空时的效果。


### V 2.6.0 (2016.10.22)

* 修复取消按钮不显示时 UI 上的一个 Bug。另外你可以通过设置 `cancelButtonTitle``nil``@""` 来不显示取消按钮,这是一个 Tip,并不是一个 Feature。。。
Expand Down

0 comments on commit 8b03463

Please sign in to comment.