From 23e07ccddbf49c2f2039631d4723197413bb448d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8C=AF=E6=A0=87?= Date: Thu, 6 Jul 2017 17:33:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=AE=BE=E7=BD=AEpl?= =?UTF-8?q?aceholder=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E9=AB=98=E5=BA=A6=E5=8A=9F=E8=83=BD=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WZBTextView-demo/ViewController.m | 4 ++-- WZBTextView-demo/WZBTextView/UITextView+WZB.m | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WZBTextView-demo/ViewController.m b/WZBTextView-demo/ViewController.m index bac2689..111cecd 100644 --- a/WZBTextView-demo/ViewController.m +++ b/WZBTextView-demo/ViewController.m @@ -20,7 +20,7 @@ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; - [self test1]; + [self test2]; } - (void)test1 { @@ -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; diff --git a/WZBTextView-demo/WZBTextView/UITextView+WZB.m b/WZBTextView-demo/WZBTextView/UITextView+WZB.m index b7594f4..c091679 100644 --- a/WZBTextView-demo/WZBTextView/UITextView+WZB.m +++ b/WZBTextView-demo/WZBTextView/UITextView+WZB.m @@ -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; }