일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- notification
- activity
- 백준
- Navigation
- 코틀린
- CoordinatorLayout
- HTTP
- View
- room
- recyclerview
- sqlite
- 안드로이드
- CollapsingToolbarLayout
- BOJ
- Coroutine
- Algorithm
- Behavior
- DataBinding
- kotlin
- 알림
- Android
- onMeasure
- CustomView
- LiveData
- 알고리즘
- onLayout
- lifecycle
- hilt
- ViewModel
- AppBarLayout
- Today
- Total
목록AttributeSet (2)
개발일지

AttributeSet Android는 XML에서 View를 생성할 때 값을 설정할 수 있는 AttributeSet 인터페이스를 제공합니다. AttributeSet을 통해 View를 생성하면서 기본값을 쉽게 설정할 수 있습니다. View 만들기 View를 상속받고 기본 생성자를 설정한다. class ProgressView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0) : View(context, attrs, defStyleAttr, defStyleRes) { } AttributeSet 만들기 attr.xml에 선언하여 만들 수 있다. refe..

Android는 View와 ViewGroup을 통해 UI를 구축하여 사용자와 상호작용할 수 있다. 기본적으로 Button, TextView 등의 View와 ConstraintLayout, LinearLayout 등의 ViewGroup을 제공하기 때문에 쉽게 앱을 제작할 수 있다. 하지만 기본적으로 제공하는 View와 ViewGroup으로 원하는 UI를 구축할 수 없는 경우가 있으며, 이런 경우 View와 ViewGroup을 상속받아 직접 구현할 수 있고 기존의 정의된 View를 상속받아 기능을 확장할 수 있다. View Method View에서 제공하는 Method를 재정의하면서 View를 Custom화 할 수 있다. 구분 함수 설명 생성 constructor(Context) 코드에서 View를 생성할 ..