Hello guys!
I have an iPad project. In the project I have a toolbar and then I add a textfield on it. Here's my simplified code.
- (void)viewDidLoad {
[super viewDidLoad];
UITextField *pageNumbersView = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
pageNumbersView.clearsOnBeginEditing = YES;
pageNumbersView.borderStyle = UITextBorderStyleRoundedRect;
pageNumbersView.textAlignment = UITextAlignmentCenter;
pageNumbersView.userInteractionEnabled = YES;
pageNumbersView.keyboardType = UIKeyboardTypeNumberPad;
pageNumbersView.returnKeyType = UIReturnKeyDone;
UIBarButtonItem *pagesIndicator = [[UIBarButtonItem alloc] initWithCustomView:pageNumbersView];
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 100, 768, 44)];
toolbar.items = [NSArray arrayWithObject:pagesIndicator];
[self.view addSubview:toolbar];
}
When I click the textfield the keyboard appears. Now the problem is that on the keyboard I press the rightmost button on the bottom of the keyboard (Keyboard hide button?) and nothing happens. If I add my textfield to the view not to the toolbar it is working. Any idea about the problem? How can I solve it? Thanks for the answers.