ScrollView .scrollTo not working? Saving ScrollView position on rotation

前端 未结 7 1493
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 02:18

Ok.. I must be overlooking something real simple here, but i think i\'m trying to do something fairly basic.. Simply retain the scrollbar position of a ScrollView on orienta

7条回答
  •  长情又很酷
    2020-12-05 02:32

    I figured it out.

    Since I'm using setText to TextViews in my onCreate, calling .scrollTo won't work.

    So now I'm using the following:

    sView.post(new Runnable() {
        @Override
        public void run() {
            sView.scrollTo(sViewX, sViewY);
        } 
    });
    

提交回复
热议问题