티스토리 뷰
CheckedTextView 는 TextView 를 상속받고 있으며 선택이 가능하다록 checkbox 를 함께 제공한다.
일반적으로 리스트 아이템에 선택(선택 or 해제) 기능이 필요한 경우 많이 쓰인다.
How to
◼ CheckedTextView code in XML
◼ CheckedTextView code in JAVA
Attributes
◼ id
id 는 해당 checked text view 를 유일하게 식별할 수 있는 속성이다.
◼ checkmark
check mark 를 설정한다.
check mark 선택 시 on / off 를 하고 싶다면 setOnClickListener 를 설정해야 한다.
◼ checked
CheckedTextView 에 "true" or "false" 로 선택 or 해제 상태를 설정한다.
◼ gravity
Text 를 정렬할 수 있는 속성이다.
- textAlignment="gravity" 가 선언되어 있어야 한다.
- layout_width, layout_height 이 wrap_content 이면 text 가 정렬될 공간이 없어 정렬이 안된다.
- gravity 를 지정하지 않으면 기본 속성인 left, top 이 적용된다.
[Android/Layout] - TextView gravity
◼ text
CheckedTextView 에 표시할 text 를 설정한다.
◼ textColor
Text 의 색상을 설정한다.
- “#argb”, “#rgb”, “#rrggbb”, or “#aarrggbb” 형태로 지정할 수 있다.
◼ textSize
Text 의 크기를 설정한다.
- sp(scale independent pixel) or dp(density pixel) 로 설정 할 수 있다.
◼ textStyle
Text 의 style 을 설정한다.
- "bold"(굵게), "italic"(이태릭), "normal"(기본) 을 설정할 수 있고 "|" 로 2개 이상의 설정을 할 수 있다.
◼ background
CheckedTextView 의 배경색을 설정한다.
- color 값이나 drawable 을 설정할 수 있다.
◼ padding
CheckedTextView 의 왼쪽, 오른쪽, 위, 아래 padding 을 설정한다.
◼ drawableBottom, drawableTop, drawableLeft, drawableRight
drawable 객체를 표시할 위치를 지정한다.
'Android > UI' 카테고리의 다른 글
| TextClock (0) | 2019.08.27 |
|---|---|
| Chronometer (0) | 2019.08.27 |
| SeekBar (0) | 2019.08.27 |
| RatingBar (0) | 2019.08.27 |
| ProgressBar (0) | 2019.08.27 |
- Total
- Today
- Yesterday
- 앱테크 추천
- bindservice
- registerForContextMenu
- 리워드 어플
- mPANDO
- onCreateContextMenu
- StartService
- Android Service
- 채굴앱
- notifyDataSetChanged
- android task
- onContextItemSelected
- RoomDatabase
- task 생성
- 리워드앱
- android intent
- 안드로이드 인텐트
- M2E
- StringUtils
- 안드로이드 서비스
- BroadcastReceiver
- p2e
- android flag activity
- 앱테크
- task
- Intent
- 무료채굴
- WEMIX
- 무료 채굴
- android activity flag
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |

