简体   繁体   中英

Titanium - createAlertDialog on iOS with secure_text_input with number pad keyboard?

How to enable numberpad in a Alert Dialog?

This code will not open load the number pad

var dialog = Ti.UI.createAlertDialog({
    style : Titanium.UI.iPhone.AlertDialogStyle.SECURE_TEXT_INPUT,
    message : 'Please Login',
    maxLength : 4,
    keyboardType : Ti.UI.KEYBOARD_NUMBER_PAD,
    buttonNames : ['Logout', 'Login'],
    title : 'Login'
});

The keyboardType property is not supported by an alert dialog in Titanium. That is for a TextField only.

So you cant do this with Titanium, another approach would be to make a custom alert out of a Ti.UI.View with an embedded TextField.

DOC Quick Reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM