我使用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 next focus
没有java代码我怎么用,谢谢你提前。
尝试使用
android:imeOptions="actionNext"
android:nextFocusForward="@+id/etPassword"
代替:
android:nextFocusDown="@+id/etPassword"
android:imeOptions="actionNext"