提交 5cd58ba4 编写于 作者: C Chris Bracken 提交者: GitHub

Add support for TextInputType.url (#3730)

Adds support for requesting a platform keyboard optimised for entering
URLs.
上级 f990f8b0
...@@ -84,6 +84,8 @@ public class TextInputPlugin implements MethodCallHandler { ...@@ -84,6 +84,8 @@ public class TextInputPlugin implements MethodCallHandler {
int textType = InputType.TYPE_CLASS_TEXT; int textType = InputType.TYPE_CLASS_TEXT;
if (inputType.equals("TextInputType.emailAddress")) if (inputType.equals("TextInputType.emailAddress"))
textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
else if (inputType.equals("TextInputType.url"))
textType |= InputType.TYPE_TEXT_VARIATION_URI;
if (obscureText) if (obscureText)
textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS; textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
return textType; return textType;
......
...@@ -18,6 +18,8 @@ static UIKeyboardType ToUIKeyboardType(NSString* inputType) { ...@@ -18,6 +18,8 @@ static UIKeyboardType ToUIKeyboardType(NSString* inputType) {
return UIKeyboardTypePhonePad; return UIKeyboardTypePhonePad;
if ([inputType isEqualToString:@"TextInputType.emailAddress"]) if ([inputType isEqualToString:@"TextInputType.emailAddress"])
return UIKeyboardTypeEmailAddress; return UIKeyboardTypeEmailAddress;
if ([inputType isEqualToString:@"TextInputType.url"])
return UIKeyboardTypeURL;
return UIKeyboardTypeDefault; return UIKeyboardTypeDefault;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册