2013年7月5日 星期五

how to scroll to top after showing a long big ScrollView?

    
=======in your activity,override the  onWindowFocusChanged event=============
    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        ScrollView scrollView = (ScrollView) findViewById(R.id.someScrollView);
        scrollView.scrollTo(0, 0);
    }
======================================================================

沒有留言:

張貼留言