728x90
▶ build.gradle (:app)
android {
...
buildTypes {
buildFeatures {
viewBinding true
}
...
}
}
▶___Activity.kt
...
class ___Activity : AppCompatActivity() {
private lateinit var viewBinding: Activity___Binding // viewBinding
...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 바인딩 초기화
viewBinding = Activity___Binding.inflate(layoutInflater)
setContentView(viewBinding.root)
...
}
...
}
728x90
'Programming > Android' 카테고리의 다른 글
[Android Roadmap] Part2: App Components (0) | 2023.01.31 |
---|---|
[Android Roadmap] Part1: The Android Platform (0) | 2023.01.24 |
[UMC 3rd/Android] 파파고 UI 구현 (xml) (0) | 2022.10.11 |
[UMC 3rd/Android] 주요 Layout (0) | 2022.09.28 |
[UMC 3rd/Android] 대표적인 View들의 역할 및 속성 (1) | 2022.09.28 |