I think the most direct thing would be to use UITextField
with the empty style border (the first option shown in the interface builder ) and transparent background. Then you put each UITextField
within a UIView
to which you put a white background.
To handle the movement of the keyboard you can add an observer to NSNotificationCenter
that detects UIKeyboardWillShowNotification
.
All UIView
must be within a UIView
that covers the entire page and it must be within a UIScrollView
, which will allow the movement of the view up and down when it appears and disappears. keyboard, respectively.
Then, make all UITextField
have delegate to the controller that you are using to show these elements; Said controller must implement the methods of UITextFieldDelegate
and UITextViewDelegate
(the latter in case you also want to use some UITextView
).
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
_activeField = textField;
}
- (void)textFieldDidEndEditing:(UITextField *)textField
{
_activeField = nil;
}
And finally you do what they show in this link: link
Basically they show the calculations made to move UIScrollView
upon detection of the keyboard notification, based on what UITextField
is being used (variable _activeField
).