简体   繁体   English

Android:垂直滚动视图中的水平列表视图?

[英]Android: Horizontal list view in vertical scroll view?

I want to make the same implementation a pulse application . 我想将相同的实现作为脉冲应用程序

Horizontal list view inside a vertical list view. 垂直列表视图内的水平列表视图。

在此输入图像描述

i tried this project for horizontal list view, but when i am trying to scroll horizontal the vertical scroll active and the list is goes up and down. 我尝试了这个项目的水平列表视图,但当我试图水平滚动时,垂直滚动活动,列表上下移动。 how can i prevent this issues. 我该如何防止这个问题。

it's work on my app... 它在我的应用程序上运行...

just like pulse app... horizontallistview inside vertical listview 就像脉冲应用...垂直列表视图内的horizo​​ntallistview

this is the solution... 这是解决方案......

just put this code in u'r onscroll of HorizontalListview class... 只需将此代码放在您的Horizo​​ntalListview类的onscroll中......

ViewParent viewParent = getParent();

if (viewParent != null) {

    viewParent.requestDisallowInterceptTouchEvent(true);

}

It would be much easier if you paste your piece of code with your question, allowing to see why it goes wrong. 如果你用你的问题粘贴你的代码片段会更加容易,从而可以看出它出错的原因。 My best guess without this information is to check you usage of fill_parent vs wrap_content . 没有这些信息,我最好的猜测是检查你对fill_parent vs wrap_content使用情况。

i think you should use some horizontal scrollviews in a vertical scrollview. 我认为你应该在垂直scrollview中使用一些水平滚动视图。 and in each horizontal scrollview, you can give listview, gridview, etc... if you want. 并且在每个水平滚动视图中,您可以提供listview,gridview等...如果您愿意。 I think it's better solution for this problem. 我认为这是解决这个问题的更好方法。 :) :)

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

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