Android:用视图更改listview项目?

时间:2014-05-26 08:56:35

标签: android listview android-listview

我正在使用一个库来制作一个类似于三星轻扫联系手势的列表视图。

Samsung contact swipe

这是我的OnTouchListener:

for (int i = 0; i < childCount; i++) {
     child = getChildAt(i);
     child.getHitRect(rect);
     if (rect.contains(x, y)) {
          itemView = child;
          downX = motionEvent.getRawX();
          velocityTracker = VelocityTracker.obtain();
          velocityTracker.addMovement(motionEvent);

          Log.d("Swipe", "Swipe down item: " + i);
          break;
     }
}

视图变量是所选的列表视图项。现在,我需要将选定的视图更改为另一个视图。 所以问题是:我可以从View变量更改ListViewItem的布局吗?

我导入了NineOldAndroids库,也许这是一个解决方案?

这是指向我的公共github的链接,您可以在其中找到该库的代码:Github

0 个答案:

没有答案