How to create Scrollview programmatically?

后端 未结 5 2339
既然无缘
既然无缘 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:53

    you may create it as below:

    ScrollView scroll = new ScrollView(context);
    scroll.setBackgroundColor(android.R.color.transparent);
    scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                                                 LayoutParams.FILL_PARENT));
    scroll.addView(yourTableView);
    

提交回复
热议问题