Closed stephsharp closed 10 years ago
Hi! I was looking for this exact feature (actually started coding before seeing this). I got into this issue when using a date field with an UIDatePicker. Nice work @stephsharp!
@chrismiles, can you merge this please? I would like to continue using the master branch.
Thanks a lot!
@amcastror I'm glad someone else found it useful!
Looks like a good addition. Thanks @stephsharp! Are there any changes that would be needed to demonstrate the feature in the demo application?
@jessedc , on the EZFDRegistrationFormViewController.m you can change (or leave a commented line) with the change:
_registrationForm = [[EZForm alloc] init];
_registrationForm.inputAccessoryType = EZFormInputAccessoryTypeDone;
_registrationForm.delegate = self;
Or with the commented line:
_registrationForm = [[EZForm alloc] init];
/*
* To hide the prev and next buttons, change the type to:
* _registrationForm.inputAccessoryType = EZFormInputAccessoryTypeDone;
*/
_registrationForm.inputAccessoryType = EZFormInputAccessoryTypeStandard;
_registrationForm.delegate = self;
That makes the example work with no navigation buttons.
Is that ok?
@amcastror Good suggestion, but I would probably change the inputAccessoryType
in the Simple Login Form instead. It only has 2 fields and doesn't scroll, so the prev/next buttons wouldn't be missed so much.
EZFDSimpleLoginFormViewController: EZFormInputAccessoryTypeDone
EZFDRegistrationFormViewController: EZFormInputAccessoryTypeStandard
EZFDScrollViewFormViewController: EZFormInputAccessoryTypeStandardLeftAligned
@jessedc your thoughts?
@stephsharp lets do what you suggested. Could you make that change and add it to your PR? Then we can merge it.
@jessedc done
Nice! Thanks a lot @stephsharp.
@jessedc, could you please merge this? I would love to stop using my custom fix. Thanks!
Hi, Sory to be annoying @jessedc , but can you please merge this?
Thanks a lot!
I just want to have a look before I merge it. I will get to it this weekend ;) I really appreciate the reminder! :rocket:
I added additional
EZFormInputAccessoryType
s (EZFormInputAccessoryTypeDone
andEZFormInputAccessoryTypeDoneLeftAligned
) to give the option of only showing a Done button in a form's input accessory view. The standard input accessory type also has previous and next buttons, which aren't necessary in forms where only one field can become the first responder.Here's the situation where these new types would be useful:
You have a form with multiple fields where
canBecomeFirstResponder
equalsNO
(and these fields are therefore skipped over by the previous/next buttons in the input accessory view). For example:EZFormRadioField
,EZFormBooleanField
andEZFormContinuousField
.You have only one field in the form where
canBecomeFirstResponder == YES
, and the input view for this field cannot dismiss itself. For example:EZFormTextField
where keyboard has no Done/Return button (e.g. num pad)EZFormRadioField
with aUIPickerView
input viewEZFormDateField
with aUIDatePicker
input viewUITextView
where Return adds a new line instead of dismissing the keyboardIn these cases it's useful to have a Done button to dismiss the input view, but the previous/next buttons on the input accessory view are unnecessary.
I'm not sure if this situation occurs all that often, but I needed these extra
EZFormInputAccessoryType
s in my current project (where I have a form with multiple radio fields and one text field). Any feedback would be great. Thanks!