일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- View
- room
- HTTP
- hilt
- CollapsingToolbarLayout
- Coroutine
- sqlite
- recyclerview
- Algorithm
- 알림
- CustomView
- onMeasure
- notification
- 백준
- kotlin
- onLayout
- LiveData
- Android
- 안드로이드
- 코틀린
- 알고리즘
- Behavior
- ViewModel
- activity
- AppBarLayout
- BOJ
- Navigation
- lifecycle
- CoordinatorLayout
- DataBinding
- Today
- Total
목록ViewGroup (2)
개발일지
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cC7IGd/btq3Kevn0tW/2GxSj5dYKkROtiUTQbMBK0/img.png)
CustomeViewGroup Android에서 기본으로 제공하는 ViewGroup(Layout) 대신 ViewGroup을 상속받아 UI를 구축할 수 있다. OverlapLayout 전체코드 class OverlapLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0) : ViewGroup(context, attrs, defStyleAttr, defStyleRes) { override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { var width = 0 var height..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cI1D0A/btq3JeO4mSV/V8R7Hr5oZk5xBxu2Jso5A1/img.png)
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를 생성할 ..