Simple swipe gesture to activity tutorial?
Show button in a list view on swiping one item from that list
有一点是,每个人都在给代码,没有人在解释发生了什么.
然后我问了这个Android list view Right / Left swipes like call logs,其中@CommonsWare已经回答了SwipeListView库,它具有顺畅的流程然后被接受的答案.接受的答案也正常工作,我目前只使用这个答案.
这是图书馆http://www.androidviews.net/2013/03/swipelistview/
其中提供了这样的列表
我已经尝试了超过50次运行github这里提供的示例应用程序这里https://github.com/47deg/android-swipelistview-sample但每次我面临新的问题.目前即将到来的例外
05-22 15:35:19.392: E/AndroidRuntime(980): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fortysevendeg.android.swipelistview.SwipeListView" on path: /data/app/com.fortysevendeg.android.swipelistview-2.apk
我不知道发生了什么事我已经检查了buildpath,图书馆也被问到这么多人在stackoverflow聊天,但没有任何帮助.
实际上在互联网上没有一个单一的教程来执行,我已经问这么多人了.所以我想知道有人使用这个图书馆请写一个适当的答案如何使用它preporly所以与我其他未来的读者也可以从中受益.
或者还有其他库来执行这种功能.
正如@CommonsWare所建议的.我写了一封电子邮件给作者也写了一个使用它的教程.
解决方法
奇迹般有效.感谢47Degrees写了如此精彩的代码片段.
解:
什么不工作?
将JAR作为依赖关系和attrs.xml在res / values中,或者将SwipeListView库引用为项目中的lib依赖关系不起作用.
什么工作?
在应用程序包中包含以下类.确保将这些类中的包名称更正为包名称
> SwipeListView.java
> SwipeListViewListener.java
> SwipeListViewListenerBase.java
> SwipeListViewTouchListener.java
将以下xml包含到应用程序res / values文件夹中
> attrs.xml
现在您可以按如下所示定义和使用SwipeListView
<au.com.your.package.SwipeListView xmlns:swipe="http://schemas.android.com/apk/res-auto" android:id="@+id/swipe_listview" android:listSelector="#00000000" android:layout_width="match_parent" android:layout_height="match_parent" swipe:swipeFrontView="@+id/front" swipe:swipeBackView="@+id/back" swipe:swipeActionLeft="reveal" swipe:swipeActionRight="choice" swipe:swipeMode="both" swipe:swipeCloseAllItemsWhenMoveList="true" swipe:swipeOpenOnLongPress="true" swipe:swipeAnimationTime="100" swipe:swipeOffsetLeft="50dp" swipe:swipeDrawableChecked="@drawable/item_selected" swipe:swipeDrawableUnchecked="@drawable/item_unselected" />
活动代码可以使用与example on SwipeListView github site中显示的相同.
您将需要从上面的代码中更正一些导入.此外,您需要将NineOldAndroids by Jake Wharton作为lib依赖项包含在您的项目中.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。