Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android View动画和异步任务_Android_Animation_Menu_Scroll - Fatal编程技术网

Android View动画和异步任务

Android View动画和异步任务,android,animation,menu,scroll,Android,Animation,Menu,Scroll,我有我的水平主菜单,我希望它移动点击的项目到中心。在HorizontalScrollView中单击事件时,我有类似的内容 int screenWidth = getWindowManager().getDefaultDisplay().getWidth(); final int pos = v.getLeft() - (screenWidth/2 - v.getWidth()/2); final HorizontalScrollView hsv = (HorizontalScrollView)f

我有我的水平主菜单,我希望它移动点击的项目到中心。在HorizontalScrollView中单击事件时,我有类似的内容

int screenWidth = getWindowManager().getDefaultDisplay().getWidth();
final int pos = v.getLeft() - (screenWidth/2 - v.getWidth()/2);
final HorizontalScrollView hsv = (HorizontalScrollView)findViewById(R.id.my_scrollview);
hsv.setSmoothScrollingEnabled(true);
hsv.smoothScrollTo(pos, 0);

//my asyncTask to load list of headlines
new LoadLocalHeadlinesTask().execute();
除了在HorizontalScrollView的“平滑”动画完成之前调用onPostExecute()方法(该方法使用新项更新listView)之外,一切都正常。因此,动画一点也不平滑

你能帮我吗,也许你知道不同的方法

谢谢