{"id":788,"date":"2015-06-12T15:02:18","date_gmt":"2015-06-12T07:02:18","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=788"},"modified":"2026-08-18T12:58:41","modified_gmt":"2026-08-18T04:58:41","slug":"android%e6%96%87%e6%9c%ac%e8%be%93%e5%85%a5%e6%8e%a7%e4%bb%b6edittext","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=788","title":{"rendered":"Android\u6587\u672c\u8f93\u5165\u63a7\u4ef6EditText"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\">EditText \u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u8bf4\u662f\u7528\u6237\u548c Android \u5e94\u7528\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u7684\u7a97\u6237\uff1a\u7528\u6237\u53ef\u4ee5\u628a\u6570\u636e\u4f20\u7ed9\u5e94\u7528\uff0c\u7136\u540e\u5f97\u5230\u60f3\u8981\u7684\u6570\u636e\u3002EditText \u662f TextView \u7684\u5b50\u7c7b\uff0c\u6240\u4ee5 TextView \u7684\u65b9\u6cd5\u548c\u7279\u6027\u540c\u6837\u5b58\u5728\u4e8e EditText \u4e2d\u3002<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<p style=\"margin: 1em 0px;\">\u5b66\u4e60\u5185\u5bb9\uff1a1. \u5e38\u7528\u5c5e\u6027\uff1b2. \u6587\u672c\u76d1\u542c TextChangedListener\uff1b3. \u9519\u8bef\u63d0\u793a setError\uff1b4. \u81ea\u5b9a\u4e49\u6837\u5f0f\u3002<\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001\u957f\u5ea6\u3001hint \u4e0e\u662f\u5426\u53ef\u7f16\u8f91<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">EditText \u6709\u4e00\u4e9b\u5c5e\u6027\u53ef\u4ee5\u8bbe\u7f6e\u7279\u6027\uff0c\u6bd4\u5982\u6700\u5927\u957f\u5ea6\u3001\u7a7a\u767d\u63d0\u793a\u6587\u5b57\u7b49\u3002\u6709\u65f6\u53ea\u80fd\u8f93\u5165\u7279\u5b9a\u4e2a\u6570\u7684\u5b57\u7b26\uff0c\u6bd4\u5982\u8eab\u4efd\u8bc1\u53f7\u3001\u624b\u673a\u53f7\u7801\uff0c\u8fd9\u65f6\u53ef\u4ee5\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:maxLength<\/code> \u8bbe\u7f6e\u6700\u5927\u8f93\u5165\u5b57\u7b26\u4e2a\u6570\uff0c\u4f8b\u5982 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:maxLength=&quot;4&quot;<\/code> \u5c31\u8868\u793a\u6700\u591a\u80fd\u8f93\u5165 4 \u4e2a\u5b57\u7b26\uff0c\u518d\u591a\u5c31\u8f93\u5165\u4e0d\u8fdb\u53bb\u4e86\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u7a7a\u767d\u63d0\u793a\u6587\u5b57\uff1a\u9700\u8981\u8bf4\u660e\u8fd9\u4e2a EditText \u662f\u505a\u4ec0\u4e48\u7528\u7684\uff0c\u6bd4\u5982\u8f93\u5165\u300c\u7528\u6237\u540d\u300d\u6216\u300c\u7535\u8bdd\u53f7\u7801\u300d\uff0c\u53c8\u4e0d\u60f3\u5728\u524d\u9762\u52a0\u4e00\u4e2a TextView\u3002EditText \u63d0\u4f9b\u4e86 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:hint<\/code> \u6765\u8bbe\u7f6e\u5185\u5bb9\u4e3a\u7a7a\u65f6\u663e\u793a\u7684\u6587\u672c\uff0c\u8f93\u5165\u5b57\u7b26\u540e\u5c31\u6d88\u5931\uff0c\u4e0d\u5f71\u54cd\u771f\u6b63\u7684\u6587\u672c\u3002\u4fee\u6539 main.xml \u5982\u4e0b\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:maxLength=&quot;40&quot;\n\n    android:hint=&quot;\u8bf7\u8f93\u5165\u7528\u6237\u540d...&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5982\u679c\u4e0d\u60f3\u8981\u7070\u8272\u63d0\u793a\u6587\u5b57\uff0c\u53ef\u4ee5\u901a\u8fc7 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:textColorHint<\/code> \u6362\u989c\u8272\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:maxLength=&quot;40&quot;\n\n    android:hint=&quot;\u8bf7\u8f93\u5165\u7528\u6237\u540d...&quot;\n\n    android:textColorHint=&quot;#238745&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u8fd8\u6709\u4e00\u4e2a\u6bd4\u8f83\u5b9e\u7528\u7684\u529f\u80fd\uff1a\u8bbe\u7f6e\u4e0d\u53ef\u7f16\u8f91\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:enabled=&quot;false&quot;<\/code> \u53ef\u4ee5\u5b9e\u73b0\u4e0d\u53ef\u7f16\u8f91\uff0c\u4f46\u53ef\u4ee5\u83b7\u5f97\u7126\u70b9\u3002\u8fd9\u65f6 EditText \u548c\u4e00\u4e2a TextView \u5dee\u4e0d\u591a\u3002<\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001\u8f93\u5165\u7279\u6b8a\u683c\u5f0f\u7684\u5b57\u7b26<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5f00\u53d1\u65f6\u4e0d\u514d\u8981\u8f93\u5165\u5bc6\u7801\uff08\u63a9\u7801\u663e\u793a\uff09\u3001\u7535\u8bdd\u53f7\u7801\uff08\u6570\u5b57\u548c -\uff09\u3001\u6570\u5b57\u7b49\u7279\u6b8a\u683c\u5f0f\u3002\u5f3a\u5927\u7684 EditText \u540c\u6837\u63d0\u4f9b\u4e86\u8fd9\u4e9b\u8bbe\u7f6e\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5bc6\u7801\u6587\u672c\u6846\uff1a\u914d\u7f6e <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:password=&quot;true&quot;<\/code> \u5373\u53ef\u3002\u8f93\u5165\u7684\u5b57\u7b26\u4f1a\u88ab\u300c.\u300d\u8fd9\u6837\u7684\u63a9\u7801\u4ee3\u66ff\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:password=&quot;true&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u4e13\u95e8\u8f93\u5165\u7535\u8bdd\u53f7\u7801\uff1a\u8bbe\u7f6e <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:phoneNumber=&quot;true&quot;<\/code> \u5c31\u53ef\u4ee5\u628a EditText \u53d8\u6210\u53ea\u63a5\u53d7\u7535\u8bdd\u53f7\u7801\u7684\u6587\u672c\u6846\uff0c\u8fde\u8f6f\u952e\u76d8\u90fd\u53d8\u6210\u62e8\u53f7\u4e13\u7528\uff0c\u4e0d\u7528\u518d\u62c5\u5fc3\u8f93\u5165\u5176\u4ed6\u5b57\u7b26\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:phoneNumber=&quot;true&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u53ea\u60f3\u8f93\u5165\u6570\u5b57\uff1a\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:numeric<\/code> \u63a7\u5236\u6570\u5b57\u7c7b\u578b\uff0c\u4e00\u5171\u4e09\u79cd\uff1ainteger\uff08\u6b63\u6574\u6570\uff09\u3001signed\uff08\u5e26\u7b26\u53f7\u6574\u6570\uff09\u548c decimal\uff08\u6d6e\u70b9\u6570\uff09\u3002\u4ee5 signed \u4e3a\u4f8b\uff0c\u8f6f\u952e\u76d8\u4f1a\u53d8\u6210\u6570\u5b57\u952e\u76d8\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:numeric=&quot;signed&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e09\u3001\u4e3a\u6587\u672c\u6307\u5b9a\u8f6f\u952e\u76d8\u7c7b\u578b<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u524d\u9762\u6307\u5b9a\u7535\u8bdd\u53f7\u7801\u540e\u952e\u76d8\u4f1a\u81ea\u52a8\u53d8\u6210\u62e8\u53f7\u952e\u76d8\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:inputType<\/code> \u8bbe\u7f6e\u6587\u672c\u7c7b\u578b\uff0c\u8ba9\u8f93\u5165\u6cd5\u9009\u62e9\u5408\u9002\u7684\u8f6f\u952e\u76d8\u3002inputType \u6709\u5f88\u591a\u7c7b\u578b\uff0c\u8fd9\u91cc\u7528 date \u6f14\u793a\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:inputType=&quot;date&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u56db\u3001Enter \u952e\u56fe\u6807\uff08imeOptions\uff09<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u8f6f\u952e\u76d8\u7684 Enter \u952e\u9ed8\u8ba4\u663e\u793a\u300c\u5b8c\u6210\u300d\u3002\u6309 Enter \u8868\u793a\u524d\u7f6e\u5de5\u4f5c\u51c6\u5907\u5b8c\u6bd5\uff0c\u4f8b\u5982\u641c\u7d22\u65f6\u5e0c\u671b\u663e\u793a\u300c\u641c\u7d22\u300d\u6216\u641c\u7d22\u56fe\u6807\u3002\u901a\u8fc7 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">android:imeOptions<\/code> \u53ef\u4ee5\u6539\u53d8\u9ed8\u8ba4\u7684\u300c\u5b8c\u6210\u300d\u6587\u672c\u3002\u5e38\u7528\u5e38\u91cf\u503c\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section>actionUnspecified \u672a\u6307\u5b9a\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_UNSPECIFIED<\/section>\n<\/li>\n<li>\n<section>actionNone \u6ca1\u6709\u52a8\u4f5c\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_NONE<\/section>\n<\/li>\n<li>\n<section>actionGo \u53bb\u5f80\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_GO<\/section>\n<\/li>\n<li>\n<section>actionSearch \u641c\u7d22\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_SEARCH<\/section>\n<\/li>\n<li>\n<section>actionSend \u53d1\u9001\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_SEND<\/section>\n<\/li>\n<li>\n<section>actionNext \u4e0b\u4e00\u4e2a\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_NEXT<\/section>\n<\/li>\n<li>\n<section>actionDone \u5b8c\u6210\uff0c\u5bf9\u5e94 EditorInfo.IME_ACTION_DONE<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">\u4e0b\u9762\u4ee5\u641c\u7d22\u4e3a\u4f8b\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:imeOptions=&quot;actionSearch&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">HelloEditText \u5982\u4e0b\u3002\u8fd0\u884c\u540e\u70b9\u51fb\u56de\u8f66\uff08\u641c\u7d22\u56fe\u6807\u8f6f\u952e\u76d8\u6309\u94ae\uff09\u4f1a\u663e\u793a\u8be5 actionId\uff0c\u5bf9\u5e94\u4e0a\u9762\u6bcf\u4e2a\u8bbe\u7f6e\u7684\u5e38\u91cf\u503c\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">package com.flysnow;\n\nimport android.app.Activity;\n\nimport android.os.Bundle;\n\nimport android.view.KeyEvent;\n\nimport android.widget.EditText;\n\nimport android.widget.TextView;\n\nimport android.widget.Toast;\n\nimport android.widget.TextView.OnEditorActionListener;\n\npublic class HelloEditText extends Activity {\n\n    \/** Called when the activity is first created. *\/\n\n    @Override\n\n    public void onCreate(Bundle savedInstanceState) {\n\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.main);\n\n        EditText editText=(EditText)findViewById(R.id.edit_text);\n\n        editText.setOnEditorActionListener(new OnEditorActionListener() {\n\n            @Override\n\n            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n\n                Toast.makeText(HelloEditText.this, String.valueOf(actionId), Toast.LENGTH_SHORT).show();\n\n                return false;\n\n            }\n\n        });\n\n    }\n\n}<\/code><\/pre>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e94\u3001\u53d6\u503c\u3001\u5168\u9009\u3001\u90e8\u5206\u9009\u62e9\u3001\u83b7\u53d6\u9009\u4e2d\u6587\u672c<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">main.xml\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    &gt;\n\n&lt;EditText\n\n    android:id=&quot;@+id\/edit_text&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\n\n    android:imeOptions=&quot;actionSearch&quot;\/&gt;\n\n&lt;Button\n\n    android:id=&quot;@+id\/btn_get_value&quot;\n\n    android:text=&quot;\u53d6\u503c&quot;\n\n    android:layout_width=&quot;wrap_content&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\/&gt;\n\n&lt;Button\n\n    android:id=&quot;@+id\/btn_all&quot;\n\n    android:text=&quot;\u5168\u9009&quot;\n\n    android:layout_width=&quot;wrap_content&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\/&gt;\n\n&lt;Button\n\n    android:id=&quot;@+id\/btn_select&quot;\n\n    android:text=&quot;\u4ece\u7b2c2\u4e2a\u5b57\u7b26\u5f00\u59cb\u9009\u62e9&quot;\n\n    android:layout_width=&quot;wrap_content&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\/&gt;\n\n&lt;Button\n\n    android:id=&quot;@+id\/btn_get_select&quot;\n\n    android:text=&quot;\u83b7\u53d6\u9009\u4e2d\u6587\u672c&quot;\n\n    android:layout_width=&quot;wrap_content&quot;\n\n    android:layout_height=&quot;wrap_content&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">HelloEditText \u4fee\u6539\u5982\u4e0b\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">import android.app.Activity;\n\nimport android.os.Bundle;\n\nimport android.text.Editable;\n\nimport android.text.Selection;\n\nimport android.view.KeyEvent;\n\nimport android.view.View;\n\nimport android.view.View.OnClickListener;\n\nimport android.widget.Button;\n\nimport android.widget.EditText;\n\nimport android.widget.TextView;\n\nimport android.widget.Toast;\n\nimport android.widget.TextView.OnEditorActionListener;\n\n\/**\n\n * EditText\u6f14\u793a\n\n * @since 2010-11-29\n\n *\/\n\npublic class HelloEditText extends Activity {\n\n    \/** Called when the activity is first created. *\/\n\n    @Override\n\n    public void onCreate(Bundle savedInstanceState) {\n\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.main);\n\n        final EditText editText=(EditText)findViewById(R.id.edit_text);\n\n        \/\/\u76d1\u542c\u56de\u8f66\u952e\n\n        editText.setOnEditorActionListener(new OnEditorActionListener() {\n\n            @Override\n\n            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n\n                Toast.makeText(HelloEditText.this, String.valueOf(actionId), Toast.LENGTH_SHORT).show();\n\n                return false;\n\n            }\n\n        });\n\n        \/\/\u83b7\u53d6EditText\u6587\u672c\n\n        Button getValue=(Button)findViewById(R.id.btn_get_value);\n\n        getValue.setOnClickListener(new OnClickListener() {\n\n            @Override\n\n            public void onClick(View v) {\n\n                Toast.makeText(HelloEditText.this, editText.getText().toString(), Toast.LENGTH_SHORT).show();\n\n            }\n\n        });\n\n        \/\/\u8ba9EditText\u5168\u9009\n\n        Button all=(Button)findViewById(R.id.btn_all);\n\n        all.setOnClickListener(new OnClickListener() {\n\n            @Override\n\n            public void onClick(View v) {\n\n                editText.selectAll();\n\n            }\n\n        });\n\n        \/\/\u4ece\u7b2c2\u4e2a\u5b57\u7b26\u5f00\u59cb\u9009\u62e9EditText\u6587\u672c\n\n        Button select=(Button)findViewById(R.id.btn_select);\n\n        select.setOnClickListener(new OnClickListener() {\n\n            @Override\n\n            public void onClick(View v) {\n\n                Editable editable=editText.getText();\n\n                Selection.setSelection(editable, 1,editable.length());\n\n            }\n\n        });\n\n      \/\/\u83b7\u53d6\u9009\u4e2d\u7684\u6587\u672c\n\n        Button getSelect=(Button)findViewById(R.id.btn_get_select);\n\n        getSelect.setOnClickListener(new OnClickListener() {\n\n            @Override\n\n            public void onClick(View v) {\n\n                int start=editText.getSelectionStart();\n\n                int end=editText.getSelectionEnd();\n\n                CharSequence selectText=editText.getText().subSequence(start, end);\n\n                Toast.makeText(HelloEditText.this, selectText, Toast.LENGTH_SHORT).show();\n\n            }\n\n        });\n\n    }\n\n    \/**\n\n     * \u4ea4\u6362\u4e24\u4e2a\u7d22\u5f15\n\n     * @param start \u5f00\u59cb\u7d22\u5f15\n\n     * @param end \u7ed3\u675f\u7d22\u5f15\n\n     *\/\n\n    protected void switchIndex(int start, int end) {\n\n        int temp=start;\n\n        start=end;\n\n        end=temp;\n\n    }\n\n}<\/code><\/pre>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u516d\u3001TextInputLayout \u6d6e\u52a8\u6807\u7b7e<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u8981\u4f7f\u7528 TextInputLayout \u63a7\u4ef6\uff0c\u9700\u8981\u5bfc\u5165\u4e24\u4e2a Library\u3002\u7b2c\u4e00\u4e2a\u662f appcompat-v7\uff0c\u786e\u4fdd material style \u53ef\u4ee5\u5411\u540e\u517c\u5bb9\uff1b\u7b2c\u4e8c\u4e2a\u662f Design Support Library\u3002\u5728 build.gradle \u4e2d\u6dfb\u52a0\u4f9d\u8d56\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">dependencies {\n\n    compile fileTree(dir: &#x27;libs&#x27;, include: [&#x27;*.jar&#x27;])\n\n    compile &#x27;com.android.support:appcompat-v7:23.4.0&#x27;\n\n    compile &#x27;com.android.support:design:23.4.0&#x27;\n\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5e03\u5c40\u6587\u4ef6\u4e2d\u4f7f\u7528\u53c2\u8003\u5982\u4e0b\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;LinearLayout\n\n        android:layout_width=&quot;match_parent&quot;\n\n        android:layout_height=&quot;wrap_content&quot;\n\n        android:orientation=&quot;vertical&quot;&gt;\n\n        &lt;EditText\n\n            android:id=&quot;@+id\/username&quot;\n\n            android:layout_width=&quot;match_parent&quot;\n\n            android:layout_height=&quot;wrap_content&quot;\n\n            android:hint=&quot;\u8f93\u5165\u7528\u6237\u540d:&quot;\n\n            android:inputType=&quot;textEmailAddress&quot; \/&gt;\n\n        &lt;android.support.design.widget.TextInputLayout\n\n            android:id=&quot;@+id\/passwordWrapper&quot;\n\n            android:layout_width=&quot;match_parent&quot;\n\n            android:layout_height=&quot;wrap_content&quot;\n\n            android:layout_marginTop=&quot;4dp&quot;&gt;\n\n            &lt;EditText\n\n                android:id=&quot;@+id\/password&quot;\n\n                android:layout_width=&quot;match_parent&quot;\n\n                android:layout_height=&quot;wrap_content&quot;\n\n                android:hint=&quot;\u8f93\u5165\u5bc6\u7801:&quot;\n\n                android:inputType=&quot;textPassword&quot; \/&gt;\n\n        &lt;\/android.support.design.widget.TextInputLayout&gt;\n\n        &lt;Button\n\n            android:id=&quot;@+id\/login_demo_btn&quot;\n\n            android:layout_width=&quot;match_parent&quot;\n\n            android:layout_height=&quot;wrap_content&quot;\n\n            android:layout_marginTop=&quot;4dp&quot;\n\n            android:text=&quot;Login&quot; \/&gt;\n\n    &lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u83b7\u53d6\u8f93\u5165\u6846 EditText \u5185\u5bb9\u53ef\u4ee5\u76f4\u63a5\u7528 TextInputLayout \u5b9e\u4f8b\u83b7\u53d6\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">final TextInputLayout passwordWrapper = (TextInputLayout) findViewById(R.id.passwordWrapper);\n\nString password = passwordWrapper.getEditText().getText().toString();<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u663e\u793a\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\"> passwordWrapper.setError(&quot;Not a valid password!&quot;);<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u53c2\u8003\uff1ahttp:\/\/www.jcodecraeer.com\/a\/basictutorial\/2015\/0821\/3338.html<\/p>\n<table style=\"border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; text-align: left; overflow: auto; display: table; overflow-wrap: break-word; word-break: break-all;\" width=\"817\">\n<thead>\n<tr>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u9700\u6c42<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u5c5e\u6027 \/ API<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u9650\u5236\u957f\u5ea6<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">android:maxLength<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u7a7a\u5185\u5bb9\u63d0\u793a<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">android:hint\u3001android:textColorHint<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u4e0d\u53ef\u7f16\u8f91<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">android:enabled=&#8221;false&#8221;<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5bc6\u7801 \/ \u7535\u8bdd \/ \u6570\u5b57<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">android:password\u3001phoneNumber\u3001numeric<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u8f6f\u952e\u76d8\u7c7b\u578b<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">android:inputType\uff08\u5982 date\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Enter \u952e\u6587\u6848<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">android:imeOptions + OnEditorActionListener<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u53d6\u503c\u4e0e\u9009\u533a<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">getText\u3001selectAll\u3001Selection.setSelection\u3001getSelectionStart\/End<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u6d6e\u52a8\u6807\u7b7e\u4e0e\u9519\u8bef<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">TextInputLayout.getEditText()\u3001setError<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1aEditText \u7528 maxLength\u3001hint\u3001password\/inputType\/imeOptions \u7ba1\u8f93\u5165\u4f53\u9a8c\uff0c\u518d\u7528 getText \u548c\u9009\u533a API \u53d6\u503c\uff1bMaterial \u4e0b\u7528 TextInputLayout \u505a\u6d6e\u52a8\u6807\u7b7e\u548c\u9519\u8bef\u63d0\u793a\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>EditText \u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u8bf4\u662f\u7528\u6237\u548c Android \u5e94\u7528\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u7684\u7a97\u6237\uff1a\u7528\u6237\u53ef\u4ee5\u628a\u6570\u636e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[195],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/788"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=788"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/788\/revisions"}],"predecessor-version":[{"id":1587,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/788\/revisions\/1587"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}