简体   繁体   English

如何通过滑动手势更改列表XML

[英]How can i change the List XML via a swipe gesture

at the moment i'm trying to write an app which has a listview, and if i swipe especially left the listitem switches to another xml like it's used in the twitter app. 目前,我正在尝试编写一个具有列表视图的应用程序,如果我特别滑动,则将listitem切换到另一个XML,就像在Twitter应用程序中使用的一样。

Especially i have a list of items only with some text and when i swipe left on a single item it changes to an other item (via a xml-file) especially with some buttons or anything else. 特别是我只有一些文本的项目列表,当我在单个项目上向左滑动时,它变成了另一个项目(通过xml文件),尤其是带有一些按钮或其他任何东西。

I hope anyone, has an idea how i can do this? 我希望有人知道我该怎么做?

Thanks. 谢谢。

I have seen this done using a Gallery set to fill_parent. 我已经看到使用设置为fill_parent的Gallery来完成此操作。 Care has to be taken to allow child views to pass on touch events appropriately for swiping to work. 必须注意允许儿童视图适当地传递触摸事件,以便滑动才能工作。 Note that Gallery is a subclass of ViewGroup. 请注意,Gallery是ViewGroup的子类。

EDIT: see comment below, i should've checked the twitter app first! 编辑:请参阅下面的评论,我应该先检查Twitter应用程序!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM