-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditableCell.m
61 lines (50 loc) · 1.58 KB
/
EditableCell.m
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
54
55
56
57
58
59
60
61
//
// EditableCell.m
// Allowance
//
// Created by Pablo Collins on 6/12/10.
//
#import "EditableCell.h"
@implementation EditableCell
- (id)initWithStyle:(UITableViewCellStyle)style placeholder:(NSString *)text {
if ((self = [super initWithStyle:style reuseIdentifier:@"cell"])) {
//self.contentView.frame = CGRectMake(4, 4, 320, 40);
textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 8, 280, 70)];
//textView.font = [UIFont fontWithName:@"Marker Felt" size:18];
textView.font = [UIFont systemFontOfSize:18];
//NSLog(@"%@", [[UIFont familyNames] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]);
//textArea.returnKeyType = UIReturnKeyDone;
//textArea.placeholder = text;
//textArea.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
//textArea.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
textView.delegate = self;
[self addSubview:textView];
}
return self;
}
- (void)setText:(NSString *)text {
textView.text = text;
}
- (NSString *)text {
return textView.text;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//[super setSelected:selected animated:animated];
}
- (void)hideKeyboard
{
[textView resignFirstResponder];
}
- (void)textViewDidBeginEditing:(UITextView *)tv
{
[textViewDelegate textViewDidBeginEditing:tv];
}
- (void)textViewDidEndEditing:(UITextView *)tv
{
[textViewDelegate textViewDidEndEditing:tv];
}
- (void)setTextViewDelegate:(id<UITextViewDelegate>)d
{
textViewDelegate = d;
}
@end