Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are on the right track with the <code>setInputAccessoryView</code> on the UITextView/UITextField classes' This method allows you to add any view you want to the top of a keyboard. The view you create would then use a delegation method to tell the main view controller to resignFirstResponder.</p> <p>So, to get you started:</p> <pre><code>@protocol TextFieldAccessoryViewDelegate @required - (void)keyboardShouldDismiss; @end @interface TextFieldAccessoryView : UIView @property (nonatomic, retain) id&lt;TextFieldAccessoryViewDelegate&gt; delegate; - (id)initWithFrame:(CGRect)frame withDelegate (id&lt;TextFieldAccessoryViewDelegate&gt;)aDelegate; @end </code></pre> <p>The implementation might look a little like (only posting the code that makes the view):</p> <pre><code>#pragma mark - Private methods - (void)doneButtonTapped:(id)sender { [delegate keyboardShouldDismiss]; } - (void)setUpChildrenView { UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneButtonTapped:)]; UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:@""]; [navigationItem setRightBarButtonItem:doneButton]; [navigationItem setHidesBackButton:YES]; UINavigationBar *navigationBar = [[[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, self.width, 44.0f)] autorelease]; [navigationBar pushNavigationItem:navigationItem animated:NO]; [self addSubview:navigationBar]; } </code></pre> <p>I have used a standard NavigationBar looking view, but you could put in anything you like and include buttons, textfields, images of robot unicorns, the works</p> <p>If you don't get everything thats going on in the above code you might need to brush up on Delegation and creating views programmatically.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload