-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatBarTextView.m
More file actions
53 lines (46 loc) · 1.47 KB
/
ChatBarTextView.m
File metadata and controls
53 lines (46 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// ChatBarTextField.m
// Hrland
//
// Created by Tousan on 15/9/18.
// Copyright (c) 2015年 Tousan. All rights reserved.
//
#import "ChatBarTextView.h"
@implementation ChatBarTextView
- (id)init;
{
self = [super init];
if (self)
{
self.layer.borderColor = [UIColor blackColor].CGColor;
self.layer.borderWidth = 1.0f;
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.scrollIndicatorInsets = UIEdgeInsetsMake(10.0f, 0.0f, 10.0f, 8.0f);
self.contentInset = UIEdgeInsetsZero;
self.scrollEnabled = YES;
self.scrollsToTop = NO;
self.userInteractionEnabled = YES;
self.font = [UIFont systemFontOfSize:16.0f];
self.textColor = [UIColor blackColor];
self.backgroundColor = [UIColor whiteColor];
self.keyboardAppearance = UIKeyboardAppearanceDefault;
self.keyboardType = UIKeyboardTypeDefault;
self.returnKeyType = UIReturnKeyDefault;
self.textAlignment = NSTextAlignmentLeft;
self.delegate = self;
_placeHolder_Label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 200, 35)];
_placeHolder_Label.textColor = [UIColor lightGrayColor];
[self addSubview:_placeHolder_Label];
}
return self;
}
- (void)drawRect:(CGRect)rect;
{
[super drawRect:rect];
[self scrollRangeToVisible:NSMakeRange(0, 0)];
}
- (void)setPlaceHolder:(NSString *)placeHolder;
{
_placeHolder_Label.text = placeHolder;
}
@end