2016-11-18 98 views
1

我使用从MySQL数据库填充的ListView,listview项的数量由数据库返回的行确定(记录更新时更改)。ListView FullScreen-Item Scroll Horizo​​ntal

  • 我不想用碎片
  • 每个ListView项具有可点击按钮(ListView的项目本身将无法点击,只对他们的按钮会)

我以为它会是一些简单的定义为ListView水平方向,但它并非如此:

<ListView 
     android:id="@+id/listView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="horizontal" 
     > 
    </ListView> 

这是我想达到的目标: enter image description here

+2

你应该看看'RecyclerView'。这是组织列表项的新方法。另外,它很容易水平显示。看看http://stackoverflow.com/questions/28460300/how-to-build-a-horizo​​ntal-listview-with-recyclerview –

回答

2

在这种情况下您可以使用HorizontalScrollViewViewPager来实现预期输出。

编辑

由于Thomas建议。你可以使用RecyclerView

+1

在他的场景中,最好使用RecyclerView而不是ViewPager或Horizo​​ntalScrollView! –

+0

是的@LalitPoptani我正在编辑我的问题,而我得到了你的评论。谢谢。 – GreenRobo

+0

您正在编辑您的问题或答案? ;):P –

相关问题