ScrollView with TableLayout programmatically Java

后端 未结 1 1846
不思量自难忘°
不思量自难忘° 2021-01-25 22:04

I have tried everything but my ScrollView doesn\'t work in my activity. I have activity where after user clicks button opens a table. I can\'t find a way that my table scrolls b

1条回答
  •  失恋的感觉
    2021-01-25 22:30

    You can make it this way and in ScrollView there must be only one child:

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

    0 讨论(0)
提交回复
热议问题