Skip to content

Commit

Permalink
修复不设置placeholder的情况下自动改变高度功能失效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
王振标 committed Jul 6, 2017
1 parent c93f571 commit 23e07cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WZBTextView-demo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];

[self test1];
[self test2];
}

- (void)test1 {
Expand All @@ -37,7 +37,7 @@ - (void)test2 {
UITextView *textView = [[UITextView alloc] initWithFrame:(CGRect){0, 0, 200, 30}];
[self.view addSubview:textView];
textView.center = self.view.center;
textView.placeholder = @"i love you";
// textView.placeholder = @"i love you";
textView.layer.borderColor = [UIColor lightGrayColor].CGColor;
textView.layer.borderWidth = 1;

Expand Down
1 change: 1 addition & 0 deletions WZBTextView-demo/WZBTextView/UITextView+WZB.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ - (void)autoHeightWithMaxHeight:(CGFloat)maxHeight {
}

- (void)autoHeightWithMaxHeight:(CGFloat)maxHeight textViewHeightDidChanged:(void(^)(CGFloat currentTextViewHeight))textViewHeightDidChanged {
[self placeholderView];
self.maxHeight = maxHeight;
if (textViewHeightDidChanged) self.textViewHeightDidChanged = textViewHeightDidChanged;
}
Expand Down

0 comments on commit 23e07cc

Please sign in to comment.