diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2014-01-07 12:23:58 +0000 |
---|---|---|
committer | Paul Gardiner <paul.gardiner@artifex.com> | 2014-01-07 12:44:23 +0000 |
commit | 9364966a041cd85a3ee4ff9c70324446a46a6414 (patch) | |
tree | 81a4cf15bf8e68f30dbfeab174ce874e94ffb306 /platform/ios/Classes/MuChoiceFieldController.m | |
parent | d2069d645c1f638fcec2ab689d86dc1c9a1aca5a (diff) | |
download | mupdf-9364966a041cd85a3ee4ff9c70324446a46a6414.tar.xz |
iOS: update the form filling dialogs to avoid the keyboard hiding the buttons
Also bring up the keyboard automatically
Diffstat (limited to 'platform/ios/Classes/MuChoiceFieldController.m')
-rw-r--r-- | platform/ios/Classes/MuChoiceFieldController.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/platform/ios/Classes/MuChoiceFieldController.m b/platform/ios/Classes/MuChoiceFieldController.m index d32383b6..d4806dbf 100644 --- a/platform/ios/Classes/MuChoiceFieldController.m +++ b/platform/ios/Classes/MuChoiceFieldController.m @@ -8,7 +8,9 @@ #import "MuChoiceFieldController.h" @interface MuChoiceFieldController () - +- (IBAction)onCancel:(id)sender; +- (IBAction)onOkay:(id)sender; +@property (retain, nonatomic) IBOutlet UIPickerView *picker; @end @implementation MuChoiceFieldController @@ -20,7 +22,7 @@ { okayBlock = Block_copy(block); choices = [_choices retain]; - selected = -1; + selected = 0; } return self; } @@ -67,14 +69,14 @@ selected = row; } -- (IBAction)okayTapped:(id)sender +- (IBAction)onOkay:(id)sender { - if (selected > -1) + if (selected >= 0 && selected < [choices count]) okayBlock([NSArray arrayWithObject:[choices objectAtIndex:selected]]); [self dismissViewControllerAnimated:YES completion:nil]; } -- (IBAction)cancelTapped:(id)sender +- (IBAction)onCancel:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } |