android - 如何修复“TextInputLaout 与 TextInputEditText 视图我无法使用 imeOption 和 nextFocustDown 属性显示下一个焦点 Edittext”
问题描述
我使用 EditText imeOption 效果很好。但是当我在 TextInputEditText 中使用 TextInputLayout 时,我看到了很多资源并在我的代码中实现它但是我无法得到我想要的实际结果。
<!--mobile number input layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:focusable="true"
android:focusableInTouchMode="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_call_24px"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/grey_text_color"
android:layout_marginLeft="@dimen/base_padding_small">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/etMobileNo"
android:inputType="textNoSuggestions"
android:hint="Mobile No"
android:singleLine="true"
android:paddingBottom="26dp"
android:backgroundTint="@color/grey_text_color"
android:textSize="18sp"
android:maxLines="1"
android:nextFocusDown="@+id/etPassword"
android:imeOptions="actionNext"
android:textColor="@color/grey_text_color"
android:textColorHint="@color/grey_text_color"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<!--Password input layout-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:focusable="true"
android:focusableInTouchMode="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_lock_24px"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleContentDescription=""
app:passwordToggleDrawable="@drawable/visibility_toggle_button"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/grey_text_color"
android:layout_marginLeft="@dimen/base_padding_small"
android:backgroundTint="@color/grey_text_color">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/etPassword"
android:hint="Password"
android:inputType="textPassword"
android:paddingBottom="26dp"
android:maxLines="1"
android:backgroundTint="@color/grey_text_color"
android:textSize="18sp"
android:imeOptions="actionDone"
android:textColor="@color/grey_text_color"
android:textColorHint="@color/grey_text_color"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
我确实帮助了这个参考,但没有工作。 Android EditText 下一个焦点
没有java代码我怎么能使用,在此先感谢。
解决方案
尝试使用
android:imeOptions="actionNext"
android:nextFocusForward="@+id/etPassword"
代替:
android:nextFocusDown="@+id/etPassword"
android:imeOptions="actionNext"
推荐阅读
- vba - 为什么我的 VBA 宏只拆分 Word 文档的第一和第三部分?
- python - 如何修复/解决 sympy dsolve 函数中的 NotImplemented 错误?
- sapui5 - 有没有办法在概览页面的条形字符列表卡中显示超过 5 个项目?
- vba - 在 Access 表单中,有没有办法使用搜索框使用 VBA 填充表单?
- javascript - 如何在excel中绑定组合框添加使用office js
- python - 在 Python 中使用 ACL 检查、编辑、删除文件或文件夹权限
- python - 如何使用 sqlalchemy 将具有 datetime.timedelta 类型数据对象的 pandas 数据帧存储到 postgresql d/b 中?
- python-3.x - 使用 sslmode 运行 postgres 连接字符串(用于 SQLAlchemy)时出现 Docker 错误
- java - Java中带有数组的构造函数链接
- vb.net - 是否可以让 WebView 控件读取本地 html 文件?