Skip to content

Commit

Permalink
Merge branch 'andyDev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dabing1022 committed May 12, 2015
2 parents 848cf3e + c7b0954 commit ce6edc4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Demos/UIKit/UITextView/UITextViewDemoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
//

#import "UITextViewDemoViewController.h"
#import "UITextView+PlaceHolder.h"

@interface UITextViewDemoViewController ()
{
UITextView *textView;
}

@end

Expand All @@ -17,6 +21,20 @@ @implementation UITextViewDemoViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.

textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 100, CGRectGetWidth(self.view.bounds) - 20, 120)];
textView.layer.borderColor = [UIColor lightGrayColor].CGColor;
textView.layer.borderWidth = 1.5f;
[textView addPlaceHolder:@"请输入您想要说的话..."];
[self.view addSubview:textView];
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint touchLoc = [touches.anyObject locationInView:self.view];
if (!CGRectContainsPoint(textView.frame, touchLoc)) {
[textView resignFirstResponder];
}
}

- (void)didReceiveMemoryWarning {
Expand Down

0 comments on commit ce6edc4

Please sign in to comment.