EditText 옵션
옵션1
이 옵션은 EditText에 글을 작성하면 한번에 지우는 X 버튼
이건 안드로이드의 기본 옵션이 아니라 github에 있는 코드를 사용해야한다.
>> 링크 https://github.com/Cielsk/clearable-edittext
GitHub - Cielsk/clearable-edittext: Simple custom view for clearable EditText.
Simple custom view for clearable EditText. Contribute to Cielsk/clearable-edittext development by creating an account on GitHub.
github.com
옵션2
키보드에 보내기 버튼
EditText에 아무 설정을 안하면 줄 바꾸기였는데, 이 옵션으로 보내기 완성 등등 다양하게 변경가능하다.
메세지 보내기 코드
<com.cielyang.android.clearableedittext.ClearableEditText
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:inputType="text" //필수
android:imeOptions="actionSend" //필수
android:imeActionLabel="보내기"/>
edittext.setOnEditorActionListener(new EditText.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
Toast.makeText(messegeDialog.this,"테스트",Toast.LENGTH_SHORT).show();
return true;
}
});
여기서 android:imeOptions="actionSend" 는 다양한 옵션이 있다.
https://recipes4dev.tistory.com/92
안드로이드 에디트텍스트 속성 4. [imeActionId, imeActionLabel, imeOptions, privateImeOptions] (Android EditText Attr
1. EditText 속성 (4) EditText 속성 리스트 및 요약 설명을 확인하시려면 [안드로이드 에디트텍스트 속성] 페이지를 참고하시기 바랍니다. EditText 속성에 대한 자세한 설명 및 예제를 확인하시려면, 아
recipes4dev.tistory.com
'안드로이드 코드' 카테고리의 다른 글
[오류해결] org.threeten.bp.zone.ZoneRulesException: No time-zone data files registered (0) | 2021.10.11 |
---|---|
[구글 스토어 API 29] 초 간단 백그라운드 위치 권환 (항상 허용 코드) (0) | 2021.08.03 |
안드로이드 홈버튼, 뒤로가기버튼, 강제종료 코드 (0) | 2021.07.29 |
안드로이드 백그라운드에서 계속 위치 받아오기 (2) | 2021.04.07 |
20201228 EditText 밑줄 없애기 (java코드) (0) | 2020.12.28 |
댓글