안드로이드에서 EditText의 텍스트 길이를 제한하는 가장 좋은 방법이 뭘까요? XML써서 가능 할까요?
<EditText android:id="@+id/input" android:layout_width="0dip" android:layout_height="wrap_content" android:inputType="number" android:maxLength="6" android:hint="@string/hint_gov" android:layout_weight="1" />
위의 예에서 android:maxLength="6"처럼 maxLength로 최대 길이의 값을 제한하면됩니다.
프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.
댓글 입력