Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes. We've done this in a few of our apps for when the user has a Bluetooth scanner "keyboard" paired with the device. What you can do is make sure your textField has an inputAccessoryView and then force the frame of the inputAccessoryView yourself. This will cause the keyboard to display on screen.</p> <p>We added the following two functions to our AppDelegate. The 'inputAccessoryView' variable is a UIView* we have declared in our app delegate:</p> <pre><code>//This function responds to all textFieldBegan editing // we need to add an accessory view and use that to force the keyboards frame // this way the keyboard appears when the scanner is attached -(void) textFieldBegan: (NSNotification *) theNotification { UITextField *theTextField = [theNotification object]; // NSLog(@"textFieldBegan: %@", theTextField); if (!inputAccessoryView) { inputAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, navigationController.view.frame.size.width, 1)]; } theTextField.inputAccessoryView = inputAccessoryView; [self performSelector:@selector(forceKeyboard) withObject:nil afterDelay:0]; } //Change the inputAccessoryView frame - this is correct for portrait, use a different // frame for landscape -(void) forceKeyboard { inputAccessoryView.superview.frame = CGRectMake(0, 759, 768, 265); } </code></pre> <p>Then in our applicationDidFinishLaunching we added this notification observer so we would get an event anytime a text field began editing</p> <pre><code> //Setup the textFieldNotifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldBegan:) name:UITextFieldTextDidBeginEditingNotification object:nil]; </code></pre> <p>Hope that helps!</p>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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