如何在水平滚动视图中添加多个ListView?

huangapple go评论83阅读模式
英文:

How can I add many Listviews inside a Horizontal scrollview?

问题

我正在尝试在Android中实现这个。有人可以帮我吗在另一个视图内水平放置动态数量的ListView
谢谢!

英文:

I am trying to achieve this in android. Can somebody help me out having a dynamic number of listview horizontally inside another view?
Thank you!

答案1

得分: 0

使用RecyclerView将会很容易。然后,您将能够设置GridLayoutmanager。GridLayoutManager有选项来设置spanCount,它将设置布局所需的span或列数。

GridLayoutManager (Context context, int spanCount, int orientation, boolean reverseLayout)

GridLayoutManager文档

还有许多教程可供查找。
教程

英文:

It will be easy if you use a RecyclerView. Then you will be able to set gridLayoutmanager. GridLayoutManager has options to set spanCount and it will set the layout to the number of required spans or columns.

GridLayoutManager (Context context, 
                int spanCount, 
                int orientation, 
                boolean reverseLayout)

GridLayoutManager Docs

There are many tutorials to find as well.
Tutorials

huangapple
  • 本文由 发表于 2020年8月3日 19:00:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/63228237.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定