Scroll to last line of TableLayout within a ScrollView

前端 未结 2 1534
悲&欢浪女
悲&欢浪女 2021-01-02 01:34

I want to have a dynamic table, with rows added over time as a result of user interaction, using a TableLayout inside a ScrollView. This works fine, but when I want to scrol

2条回答
  •  星月不相逢
    2021-01-02 02:24

    At the time you are doing your fullScroll() the layout has not happened yet, so the ScrollView uses the "old" size for the table. Instead of calling fullScroll() right away, use View.post(Runnable).

提交回复
热议问题