Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- data
- 앱바
- drift
- textfield
- ScrollView
- Compose
- android
- activity
- tabbar
- Button
- Navigation
- 테스트
- Kotlin
- binding
- Dialog
- 안드로이드
- 계측
- livedata
- TEST
- CustomScrollView
- textview
- 앱
- Flutter
- viewmodel
- appbar
- DART
- intent
- scroll
- Coroutines
- LifeCycle
Archives
- Today
- Total
목록findViewById (1)
Study Record
[안드로이드] 데이터 바인딩(Data binding)과 뷰 바인딩(View binding)
😶 findViewById() vs Data binding View에 대한 접근을 얻기 위해 사용하는 함수인 findViewById()를 사용할 수 있다. val textView = findViewById(R.id.name_tv) findViewById() 함수가 작동되는 방식은 런타임 때 뷰 계층구조를 훑으면서 인자로 받은 id 값으로 알맞은 View를 찾아서 리턴해준다. 하나의 View를 연결할 때마다 findViewById() 함수를 사용하기 때문에 접근하려는 View 가 많아질수록 비용이 많이 든다. 또한, View 가 많지 않은 간단한 앱에서는 문제가 없지만 View 의 개수가 많아지고 계층 구조가 더 깊어지면 알맞은 View를 찾는데 시간이 오래 걸려 사용자의 앱 속도가 현저히 느려질 수 있다..
안드로이드
2023. 6. 19. 16:47