आप इस कोशिश कर सकते हैं दे। आप अपनी समस्या का समाधान।
scrollView = (ScrollView) findViewById(R.id.scr);
contentView = (ViewGroup) findViewById(R.id.r2);
scrollView.setOnTouchListener(new ScrollPager(scrollView, contentView));
scrollView.post(new Runnable() {
public void run() {
scrollView.scrollTo(0, contentView.getPaddingTop());
}
});
इसके लिए आपको scroolerPager क्लास की आवश्यकता है। इसे यहां प्राप्त करें,
public class ScrollPager implements OnTouchListener
public ScrollPager(ScrollView aScrollView, ViewGroup aContentView)
{
mScrollView = aScrollView;
mContentView = aContentView;
scroller = new Scroller(mScrollView.getContext(), new OvershootInterpolator());
task = new Runnable()
{
public void run()
{
scroller.computeScrollOffset();
mScrollView.scrollTo(0, scroller.getCurrY());
if (!scroller.isFinished())
{
mScrollView.post(this);
}
}
};
}
स्रोत
2011-12-23 06:19:12
यह कोड कोई समझ नहीं आता है। कुछ भी नहीं है यहां तक कि एक साथ – JeffG
बंधा हुआ है कम से कम पोस्टिंग ... इस टुकड़ा लगता है कि यह इसके – nicolaas
तो यह और भी ListView के लिए काम कर सकते हैं: पढ़ने के लिए प्रयास ले जा whitout सामान्य नोटपैड में कोडित किया गया है इससे पहले कि समय और प्रयास की एक न्यूनतम खर्च? –