In iOS 3, this workaround involves creating a client-side UIButton and adding it as a subquery to the Apple keyboard. When iOS 4 was released, it was revealed that the subtitle was added to the modified one. Therefore, to work in iOS3 and 4, I had the following.
-(void) addDoneButtonToNumericKeyboard { if(doneButtonIsAdded) { return; } if(doneButtonForNumericKeyboard == nil) { doneButtonForNumericKeyboard= [[UIButton buttonWithType:UIButtonTypeCustom] retain]; doneButtonForNumericKeyboard.frame = CGRectMake(0, 163, 106, 53); doneButtonForNumericKeyboard.adjustsImageWhenHighlighted = NO; if ([[[UIDevice currentDevice] systemVersion] hasPrefix:@"3"]) { [doneButtonForNumericKeyboard setImage:[UIImage imageNamed:@"DoneUp3.png"] forState:UIControlStateNormal]; [doneButtonForNumericKeyboard setImage:[UIImage imageNamed:@"DoneDown3.png"] forState:UIControlStateHighlighted]; } else { [doneButtonForNumericKeyboard setImage:[UIImage imageNamed:@"DoneUp.png"] forState:UIControlStateNormal]; [doneButtonForNumericKeyboard setImage:[UIImage imageNamed:@"DoneDown.png"] forState:UIControlStateHighlighted]; } [doneButtonForNumericKeyboard addTarget:self action:@selector(doneButton:) forControlEvents:UIControlEventTouchUpInside]; }
Anyone have any ideas how to do this for iOS 5?
None of the above methods work for 5. There is an attempt to add a subview that seems successful but doesn't display anything. The area is simply blank on the screen and does not respond to touch.
source share