android - 如何在 Android 中创建水平和垂直滚动的列表视图?
问题描述
我需要一个在垂直和水平方向滚动的列表视图。
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="always"
android:scrollbarAlwaysDrawVerticalTrack="true">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:scrollbars="vertical|horizontal">
</ListView>
</HorizontalScrollView>
这是我的代码,但它只制作水平列表视图。
解决方案
首先。不要使用列表视图。而是使用带有自定义 LayoutManager 的 RecyclerView。
作为解决方案,试试这个。 创建具有水平和垂直滚动的 RecyclerView
推荐阅读
- c# - vbs到C#的转换,无法获取ScriptingEngine
- android - 如何在数据绑定中使用泛型类的变量?
- python-3.x - 使用 Matplotlib 和 FuncAnimation 为具有不同 FPS 的对象设置动画
- javascript - 根据选择下拉显示或隐藏多个字段 - jquery
- visual-studio-code - 使用具有多个文件夹的工作区时,如何在 VSCode 中仅在一个特定文件夹中搜索文件?
- facebook-instant-games - Facebook 即时游戏在 startAsync 函数终止后停止......那么我们如何在按钮单击时调用 shareAsync 函数?
- r - 按不同的因子水平过滤不同的组
- unity3d - 安卓统一游戏
- python - 更改在 kivy GUI 中显示的 matplotlib 3d 散点图的方向
- c# - 如何通过 RelayCommand (mvvmlight) 获取 ViewModel 中按钮的内容