LinearLayout에 동적으로 뷰 추가하기

Kotlin Android DEVELOPMENT IT
val textView = TextView(this)
textView.text = "글자"
lapLayout.addView(textView, 0)

//위와 같은 코드를 실행하면 텍스트뷰가 레이아웃에 추가된다.
//addView의 두번째 인자는 추가될 인덱스. 0일 경우 항상 최상단에 추가된다.

//레이아웃에 추가된 모든 뷰들을 제거하기
lapLayout.removeAllView()