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
//
// ICRQAViewController.m
// XFFruit
//
// Created by Xummer on 6/7/15.
// Copyright (c) 2015 Xummer. All rights reserved.
//
#import "ICRQAViewController.h"
#import "ICRQuestionManager.h"
@interface ICRQAViewController ()
@property (strong, nonatomic) UILabel *m_questionLabel;
@end
@implementation ICRQAViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.m_helperView.m_inputTxtF.text = self.m_answer.content;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)initScrollViewWithRect:(CGRect)rect {
[super initScrollViewWithRect:rect];
self.m_questionLabel = [[IBTUILabel alloc] init];
_m_questionLabel.numberOfLines = 0;
_m_questionLabel.font = [UIFont systemFontOfSize:17];
_m_questionLabel.textColor = [UIColor grayColor];
_m_questionLabel.text = @"请将内容填写在【备注】框中";
CGFloat fMargin = 12.0f;
CGSize size = CGSizeMake(self.view.width - 2 * fMargin,CGFLOAT_MAX);
size = [_m_questionLabel widthLimitedSizeThatFits:size];
_m_questionLabel.frame = (CGRect){
.origin.x = fMargin,
.origin.y = 0,
.size = size
};
[self.m_contentScrollView addSubview:_m_questionLabel];
}
#pragma mark - Actions
- (void)onNextBtnAction:(__unused id)sender {
if (self.m_helperView.m_inputTxtF.text.length <= 0) {
self.m_answer.bIsAnswered = NO;
return;
}
self.m_answer.content = self.m_helperView.m_inputTxtF.text;
self.m_answer.bIsAnswered = YES;
ICRQuestionManager *mgr = [ICRQuestionManager sharedManager];
UIViewController *qVC = [mgr questionViewControlAtIndex:self.m_uiIndex + 1];
if (qVC) {
[self PushViewController:qVC animated:YES];
}
else {
[self openResultView];
}
}
@end