The way to disable the action of the Return is to use delegate as @Paulo replied. But, you cannot simply lock the open keyboard in a view. This goes against good usability standards and against Apple’s usability document.
I recommend that you do a check of which Uitextfield is making the call and acting accordingly.
For example, if it is the text that called the Return, change the focus to the numeric and, if it is the numeric, collect the keyboard.
- (BOOL) textFieldShouldReturn:(UITextField *)textField {
if(textField == self.texto) {
[self.numero becomeFirstResponder];
}else {
[textField resignFirstResponder];
}
return NO;
}
Got it... in my case I’m with this problem exactly because the numeric keyboard does not have the Return button... so to avoid the difference, I was thinking about turning off the alpha keyboard button and let create the bar on top of keyboards...
– David Batista
@Davidbatistadasilva, the best solution to enable navigation in a Uitextfield numeric is actually add a button on the keyboard, through the property inputAccessoryView. If you need help with this, open a question that puts an example code.
– Igor Castañeda Ferreira
Dude, I created a new question for the button question on add a button on the Uitextfield. Follow the link [http://answall.com/questions/6199/como-addir-botao-no-keyboard-numerico-no-ios]
– David Batista
I came to see this question. But when I saw it, the question had already been answered. And, from what I saw, you found the resolution.
– Igor Castañeda Ferreira
Oh man, thanks. I wanted to confirm if this was your solution to identify the best! rs It was really worth!
– David Batista
I would give the same answer that Julio gave. Even, I believe that using inputAcessoryView is a better option than inserting a button over the number pad. This is because the Acessoryview is a known and applied market standard.
– Igor Castañeda Ferreira