How to present keyboard inside popover?, ipad passcode lock style

前端 未结 1 1042
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 16:15

Is it posible to present a keyboard the way is shown when you set a passcode for your ipad?

1条回答
  •  心在旅途
    2021-01-13 16:32

    Unfortunately no, But what i did to replicate this was, built a bunch of buttons like a keyboard inside my passcode view using interface builder. Then linked each button to a command that would change the text field.

    - (IBAction) button9_clicked:(id) sender{
    
        if ([self textField:theTextField shouldChangeCharactersInRange:range replacementString:@"9"]){
            self.theTextField.text=[self.theTextField.text stringByAppendingString:@"9"];
            range.location = self.theTextField.text.length;
        }
        else 
            range.location = self.theTextField.text.length;
    }
    

    0 讨论(0)
提交回复
热议问题