EditText imeOptions를 actionNext로 설정해도 효과가 없습니다.
상당히 복잡한 (실제로는) xml 레이아웃 파일이 있습니다. 뷰 중 하나 v1
는 EditText ( v2
) 및 다른 LinearLayout ( v3
)의 두 자식이있는 LinearLayout ( )입니다. 자식 LinearLayout에는 차례로 EditText ( v4
) 및 ImageView ( v5
)가 있습니다.
EditText v2의 경우 imeOptions가 있습니다.
android:imeOptions="actionNext"
나는 응용 프로그램을 실행할 때, 키보드의은 return
을 확인하지 않습니다 next
와 나는 변경하려는 next
. 이 문제를 어떻게 해결합니까?
또한 사용자가 다음을 클릭하면 EditText v4로 이동합니다. 내가할까요?
실제로 코드를 확인해야하는 사람들을 위해 :
<LinearLayout
android:id="@+id/do_txt_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/col6"
android:orientation="vertical"
android:visibility="gone" >
<EditText
android:id="@+id/gm_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/coldo_text"
android:hint="@string/enter_title"
android:maxLines="1"
android:imeOptions="actionNext"
android:padding="5dp"
android:textColor="pigc7"
android:textSize="ads2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal" >
<EditText
android:id="@+id/rev_text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/coldo_text"
android:hint="@string/enter_msg"
android:maxLines="2"
android:padding="5dp"
android:textColor="pigc7"
android:textSize="ads2" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/colbtn_r”
android:clickable="true"
android:onClick=“clickAct”
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:src="@drawable/abcat” />
</LinearLayout>
</LinearLayout>
android:maxLines="1" & android:inputType="text"
EditText에 추가 하기 만하면 됩니다. 작동합니다 !! :)
singleLine
더 이상 사용되지 않습니다. 입력 유형 (예 :)을 추가하는 android:inputType="text"
것도 저에게 효과적이었습니다.
사용 android:maxLines="1"
으로 singleLine
사용되지 않습니다
android:singleLine
더 이상 사용되지 않습니다 . android:maxLines="1"
와 결합하는 것이 좋습니다 android:inputType="text"
. 다음은 코드입니다.
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="text"
/>
여기에 제공된 답변은 모두 매우 유용했지만 여전히 키보드의 "Next"를 표시하기 위해 고군분투하고있었습니다.
android:digits
XML에서 Android의 속성 을 사용 하면 android:imeOptions="actionNext"
예상대로 작동 하지 않는 것으로 나타났습니다 .
대답은 실제로 deprecated를 사용하는 것 android:singleLine="True"
입니다. 이것은 IME 옵션이 존중되도록 강제하는 것 같습니다.
작동하지 않는 오래된 코드
<android.support.design.widget.TextInputEditText
android:id="@+id/first_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- "
android:ellipsize="end"
android:hint="@string/first_name"
android:imeOptions="actionNext"
android:inputType="textCapWords"
android:maxLength="35"
android:maxLines="1" />
작업 코드
<android.support.design.widget.TextInputEditText
android:id="@+id/first_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- "
android:ellipsize="end"
android:hint="@string/first_name"
android:imeOptions="actionNext"
android:inputType="textCapWords"
android:maxLength="35"
android:maxLines="1"
android:singleLine="true" />
나는 deprecated 속성을 사용하는 것을 좋아하지 않지만 현재로서는 원하는 결과를 얻는 것 같습니다.
한 줄은 더 이상 사용되지 않으므로 아래 코드를 추가하면 inputType이 필요하다고 생각합니다.
<EditText
android:inputType="text"
android:maxLines="1"
android:imeOptions="actionNext" />
Finally i have got sure solution for this issue Just add these 3 lines in your edit text and it will be working fine
android:maxLines="1"
android:inputType="text"
android:imeOptions="actionDone"
Here you can add maxLines according to your requirement. Do not use singleLine as it is deprecated now. Good luck!
android:inputType="text"
You have to specify an inputType in order for imeOptions to function.
Key here is to set input type and imeOptions attributes
<EditText
android:inputType="number"
android:maxLines="1"
android:imeOptions="actionSearch" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/auth_register_re_password"
android:hint="Enter Password Again"
android:imeActionLabel="login"
android:gravity="center"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
/>
Only this worked for me.
Change it:
android:maxLines="1"
android:inputType="text"
android:imeOptions="actionNext"
on that:
android:singleLine="true"
android:inputType="text"
android:imeOptions="actionNext"
참고URL : https://stackoverflow.com/questions/23036890/setting-edittext-imeoptions-to-actionnext-has-no-effect
'code' 카테고리의 다른 글
자바 스크립트 개체의 마지막 항목 가져 오기 (0) | 2020.10.06 |
---|---|
SQL Server 실행 포트를 찾는 방법은 무엇입니까? (0) | 2020.10.06 |
sed가 일치하지 않는 줄을 무시하도록 함 (0) | 2020.10.06 |
README의 wiki 페이지에 대한 github 링크 (0) | 2020.10.05 |
데이터베이스의 두 필드에 대해 고유 한 SQL (0) | 2020.10.05 |