Slide 19
Slide 19 text
7JFXΛϓϩάϥϜ͔Βѻ͏ʹ
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// findViewByIdͰɺViewGroupͷIDΛࢦఆ͠ɺ͞Βʹ͏ҰfindViewByIdΛॏͶΕɺViewΛऔಘͰ͖Δ
val title1 = findViewById(R.id.include_1).findViewById(R.id.title)
title1.text = "The first title"
// ViewGroupΛࢦఆ͠ͳ͔ͬͨ߹ɺ࠷ॳʹग़ݱ͢ΔView͕ରʹͳΔ
val subtitle1 = findViewById(R.id.subtitle)
subtitle1.text = "The first subtitle"
// Kotlin Android Extensions
include_2.title.text = "Second title"
include_2.subtitle.text = "Second subtitle"
include_3.title.text = "Third title"
include_3.subtitle.text = "Third subtitle"
}
}
pOE7JFX#Z*EΛݺͿʢJODMVEFॴͷJEͱɺϓϩάϥϜ͔Βѻ͏7JFXͷJEʣ
"OESPJE,59Λ༻͢ΔͱɺΊͬͪΌָ