TextField键盘不显示

KkM*_*MIW 3 iphone xamarin.ios xamarin ios7 ios8

键盘未出现在模拟器上的文本字段中.

创建了文本字段.

    txt_UserName = new UITextField {
        Placeholder = "Enter Username",
        BorderStyle = UITextBorderStyle.RoundedRect,
        Font = UIFont.FromName(Constants.KHELVETIC,Constants.KFontSize12),
        VerticalAlignment = UIControlContentVerticalAlignment.Center,
        AutocorrectionType = UITextAutocorrectionType.No,
        AutocapitalizationType = UITextAutocapitalizationType.None,
        ClearButtonMode = UITextFieldViewMode.WhileEditing,
        LeftViewMode = UITextFieldViewMode.Always,
        ReturnKeyType = UIReturnKeyType.Next,
        BackgroundColor = UIColor.White,
        ShouldReturn = delegate {
            txt_Email.BecomeFirstResponder ();
            return true;
            }
        };


    txt_Email = new UITextField {
        Placeholder = "Enter Email",
        BorderStyle = UITextBorderStyle.RoundedRect,
        Font = UIFont.FromName(Constants.KHELVETIC,Constants.KFontSize12),
        VerticalAlignment = UIControlContentVerticalAlignment.Center,
        AutocorrectionType = UITextAutocorrectionType.No,
        AutocapitalizationType = UITextAutocapitalizationType.None,
        ClearButtonMode = UITextFieldViewMode.WhileEditing,
        KeyboardType = UIKeyboardType.EmailAddress,
        LeftViewMode = UITextFieldViewMode.Always,
        ReturnKeyType = UIReturnKeyType.Next,
        BackgroundColor = UIColor.White,
        ShouldReturn = delegate {
            txt_Password.BecomeFirstResponder ();
            return true;
        }
    };
Run Code Online (Sandbox Code Playgroud)

找不到支持键盘iPhone-Portrait-PhonePad的5型键盘; 使用2870935746_Portrait_iPhone-Complex-Pad_Default

当我选择Textfield时,它会显示上面的消息.

Som*_*omu 14

您需要取消选中硬件键盘选项,以便弹出模拟器上的键盘.因为如果您有硬件键盘选项,则需要将键盘连接到您的设备以检查它是否正在接受它.

  • 或者只需按⌘K即可 (10认同)