To add an UIView just above the UIKeyBoard write the below mentioned methods to achieve it.
- -(UIView *)getTextFieldAccessoryView{
- UIButton *cancel = [UIButton buttonWithType:UIButtonTypeCustom];
- [cancel setFrame:CGRectMake(0, self.view.bounds.size.height, 320.0, 42.0)];
- [cancel setTitle:@"Cancel" forState:UIControlStateNormal];
- [cancel setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- [cancel addTarget:self action:@selector(cancelTapped) forControlEvents:UIControlEventTouchUpInside];
- return cancel;
- }
- -(void)cancelTapped{
- [self.view endEditing:YES];
- }
You can customize the view according to your requirements.
For
such more Blogs you can visit to http://findnerd.com/NerdDigest
No comments:
Post a Comment