A Salim
A Salim

Reputation: 1315

Keyboard not showing up

I have an application which prompt the user to enter a password through a popup textbox. The keyboard is not showing up for the textbox like it had in previous versions of iOS. Hoping someone can point me in the right direction. I believe this is the snippet of code dealing with the password entry functionality.

- (void)showPreferencesPasswordPrompt {
InputAlertView * inputAlert = [[InputAlertView alloc] initWithTitle:NSLocalizedString(@"browser_preferences_password_alert_title", nil)
                                                            message:NSLocalizedString(@"browser_preferences_password_alert_message", nil)
                                                           delegate:self
                                                  cancelButtonTitle:NSLocalizedString(@"cancel", nil)
                                                  otherButtonTitles:NSLocalizedString(@"ok", nil), nil];

inputAlert.tag = PREFERENCES_PASSWORD_TAG;
inputAlert.textField.secureTextEntry = YES;

[inputAlert show];
[inputAlert release];

}

Upvotes: 1

Views: 705

Answers (2)

NTamer
NTamer

Reputation: 21

I know this question is over a year old, but I just had the same problem and my solution might help someone else. In my case, a setting on the simulator was inadvertently turned on: Hardware > Keyboard > Connect Hardware Keyboard.

Once I de-selected this setting, the virtual keyboard began appearing as expected.

Upvotes: 2

HalR
HalR

Reputation: 11073

AlertViews need to have their text fields set up differently with ios 7. Something like this:

    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:nil message:NSLocalizedString(@"Rename List", @"Rename List") delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", @"Cancel") otherButtonTitles:NSLocalizedString(@"OK", @"OK"), nil];
    alert.alertViewStyle = UIAlertViewStylePlainTextInput;
    alertTextField_ = [alert textFieldAtIndex:0];
    alertTextField_.keyboardType = UIKeyboardTypeAlphabet;
    alertTextField_.placeholder = list.name;
    [alert show];
    [alertTextField_ becomeFirstResponder];

Upvotes: 1

Related Questions