728x90
체크박스의 색상(color)지정
아래와 같이 코딩하시면 됩니다...
1 | buttonView.setButtonTintList(ColorStateList.valueOf(Color.parseColor("#34BFD6"))) | cs |
체크박스가 체크 되었을때와 해제 되었을때 각각 다른색으로 표현 할경우
1 2 3 4 5 6 7 8 9 10 | checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { buttonView.setButtonTintList(ColorStateList.valueOf(Color.parseColor("#34BFD6"))); } else { buttonView.setButtonTintList(ColorStateList.valueOf(Color.parseColor("#757575"))); } } }); | cs |
isChecked는 체크박스의 체크여부 Boolean을 나타냅니다.
728x90
'프로그래밍' 카테고리의 다른 글
[mac] 맥에서 나의 mac ip 확인 방법 / mac ip 주소 확인 (0) | 2018.02.20 |
---|---|
[Linux 리눅스] 콘솔 명령어 (정리중) (0) | 2018.02.02 |
[Mysql] 테이블 INDEX 수정, 추가, 삭제, 보기 명령어 (0) | 2017.11.28 |
[Android] Fragment Constructor (프래그먼트 생성자) 사용하기 (0) | 2017.03.10 |
[MySQL] 테이블에 UNIQUE KEY 추가 생성 (0) | 2017.01.24 |