fix bug that keyboard type is not changed when using passward on iOS (#1315)

This commit is contained in:
minggo
2018-06-15 14:07:33 +08:00
committed by GitHub
parent 4e12753fff
commit 1b55dbdfd4
+14 -10
View File
@@ -174,18 +174,22 @@ namespace
void setTexFiledKeyboardType(UITextField* textField, const std::string& inputType)
{
if (0 == inputType.compare("password"))
{
textField.secureTextEntry = TRUE;
else
textField.secureTextEntry = FALSE;
if (0 == inputType.compare("email"))
textField.keyboardType = UIKeyboardTypeEmailAddress;
else if (0 == inputType.compare("number"))
textField.keyboardType = UIKeyboardTypeDecimalPad;
else if (0 == inputType.compare("url"))
textField.keyboardType = UIKeyboardTypeURL;
else if (0 == inputType.compare("text"))
textField.keyboardType = UIKeyboardTypeDefault;
}
else
{
textField.secureTextEntry = FALSE;
if (0 == inputType.compare("email"))
textField.keyboardType = UIKeyboardTypeEmailAddress;
else if (0 == inputType.compare("number"))
textField.keyboardType = UIKeyboardTypeDecimalPad;
else if (0 == inputType.compare("url"))
textField.keyboardType = UIKeyboardTypeURL;
else if (0 == inputType.compare("text"))
textField.keyboardType = UIKeyboardTypeDefault;
}
}
void setTextFieldReturnType(UITextField* textField, const std::string& returnType)