How to create Scrollview programmatically?

后端 未结 5 612
一向
一向 2021-02-07 20:01

I have one table \"TABLE_SUBJECT\" which contain a number of subjects. I need to create
one horizontal scroll view with Subject.

How do I create a ScrollView with da

5条回答
  •  一整个雨季
    2021-02-07 20:56

    In Kotlin you can use the below code

        val scroll = ScrollView(context)
        scroll.setBackgroundColor(R.color.transparent)
        scroll.layoutParams = LayoutParams(
            LayoutParams.FILL_PARENT,
            LayoutParams.FILL_PARENT
        )
        scroll.addView(yourTableView)
    

提交回复
热议问题