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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//
// ICRHelpAndFeedBackViewController.m
// XFFruit
//
// Created by Lili Wang on 15/4/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define LABEL_LEFT_PANDING (20)
#define SUBMIT_BUTTON_HEIGHT (44)
#define GRAY_LINE_WIDTH (0.5)
#define TEXTVIEW_TOP_PANDING (10)
#define TEXTVIEW_HEIGHT (120)
#import "ICRHelpAndFeedBackViewController.h"
#import "ICRPlaceholderTextView.h"
@interface ICRHelpAndFeedBackViewController ()
@end
@implementation ICRHelpAndFeedBackViewController
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self setupSubviews];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
#pragma mark - Private Method
- (void)setupSubviews {
self.title = [IBTCommon localizableString:@"Feedback"];
UILabel *label = [[UILabel alloc] initWithFrame:(CGRect){
.origin.x = LABEL_LEFT_PANDING,
.origin.y = LABEL_LEFT_PANDING,
.size.width = self.view.width - LABEL_LEFT_PANDING * 2,
.size.height = SUBMIT_BUTTON_HEIGHT
}];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont systemFontOfSize:16.0f];
label.textColor = [UIColor colorWithW:109 a:1];
label.textAlignment = NSTextAlignmentLeft;
label.text = [IBTCommon localizableString:@"Fill In The Comments:"];
[self.view addSubview:label];
CGFloat fDx = LABEL_LEFT_PANDING - 4;
UIView *contentView = [[UIView alloc] initWithFrame:(CGRect){
.origin.x = fDx,
.origin.y = label.bottom + TEXTVIEW_TOP_PANDING,
.size.width = self.view.width - fDx * 2,
.size.height = TEXTVIEW_HEIGHT
}];
contentView.layer.masksToBounds = YES;
contentView.layer.cornerRadius = 5;
contentView.backgroundColor = [UIColor lightGrayColor];
ICRPlaceholderTextView *placeView = [[ICRPlaceholderTextView alloc] initWithFrame:(CGRect){
.origin.x = GRAY_LINE_WIDTH,
.origin.y = GRAY_LINE_WIDTH,
.size.width = contentView.width - GRAY_LINE_WIDTH * 2,
.size.height = contentView.height - GRAY_LINE_WIDTH * 2
}];
placeView.layer.masksToBounds = YES;
placeView.layer.cornerRadius = 5;
placeView.font = [UIFont systemFontOfSize:16.0f];
placeView.m_placeHolder = [IBTCommon localizableString:@"Please Enter Your Comments"];
placeView.m_placeholderColor = [UIColor colorWithW:109 a:1];
[contentView addSubview:placeView];
[self.view addSubview:contentView];
UIButton *button =
[IBTCustomButtom buttonWithTitle:[IBTCommon localizableString:@"Submit Feedback"]
color:ICR_ORANGE_BTN_COLOR target:self action:@selector(onSubmit:)];
button.frame = (CGRect){
.origin.x = LABEL_LEFT_PANDING,
.origin.y = self.view.height - SUBMIT_BUTTON_HEIGHT * 2,
.size.width = self.view.width - LABEL_LEFT_PANDING * 2,
.size.height = SUBMIT_BUTTON_HEIGHT
};
button.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self.view addSubview:button];
}
#pragma mark - Actions
- (void)onSubmit:(__unused id)sender {
}
@end