[AndroidStudio-Kotlin] View Binding 뷰 바인딩
View에서 메서드를 호출하거나 속성에 액세스하기 전에, 먼저 Button 또는 TextView와 같은 View에 대한 참조를 찾아야 합니다. 안드로이드 프레임워크는 이를 위해 findViewById() 메서드를 제공합니다. findViewById() 예제 코드 // Old way with findViewById() val myButton: Button = findViewId(R.id.my_button) myButton.text = "A Button" View Binding findViewById() 대신 View Binding을 통해 UI의 뷰에서 메서드를 훨씬 더 쉽고 빠르게 호출할 수 있습니다. 1. Gradle에서 View Binding 사용 설정 앱의 build.gradle 파일을 열고 andr..
Tech/Mobile
2021. 7. 13. 10:54