How to create Scrollview programmatically?

后端 未结 5 2229
既然无缘
既然无缘 2021-02-07 20:24

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:41

    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)
    

提交回复
热议问题