private Runnable runnableYeMian = new Runnable() { @Override public void run() { // 获取组件到顶部的高度 mXunHuanBiaoGeGeShu = mTiaoZhuanXianShiLinearLayout.getTop(); // 获取屏幕高度 WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); mXunHuanBiaoGeGeShu = mXunHuanBiaoGeGeShu+(display.getHeight()/2); Log.i("巡店","滑动距离:"+mXunHuanBiaoGeGeShu); mscrollView.scrollTo(0, mXunHuanBiaoGeGeShu);// 改变滚动条的位置 Log.i("巡店","滑动"); } }; /** * 跳转页面指定位置 smoothScrollTo */ public void TiaoZhuanYeMianZhiDingWeiZhi(){ Handler handler = new Handler(); handler.postDelayed(runnableYeMian, 0); Log.i("巡店","滑动调用"); mIsTiaoZhuanWeiZhi = false; }
scrollview滚动到指定位置
最新推荐文章于 2024-09-25 09:05:12 发布