- (UIButton *)clear
{
if (!_clear) {
_clear = [[UIButton alloc]initWithFrame:CGRectMake(230, 200, 120, 40)];
[_clear setTitle:@"清 除" forState:UIControlStateNormal];
[_clear setBackgroundColor:[UIColor redColor]];
_clear.tag = 1002;
[_clear addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside];
}
return _clear;
}
- (UITextField *)textField
{
if (!_textField) {
_textField = [[UITextField alloc]initWithFrame:CGRectMake(20, 50, 240, 30)];
_textField.placeholder = @"输入你想说的话";
_textField.font = [UIFont systemFontOfSize:15];
_textField.borderStyle = UITextBorderStyleRoundedRect;
}
return _textField;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:self.textField];
[self.view addSubview:self.lable];
[self.view addSubview:self.submit];
[self.view addSubview:self.clear];
}