Android - 如何创建从右到左的水平ListView?

标签 android listview horizontal-scrolling

是否有一种实用的方法(一般来说)在 Android 中创建从右到左的水平 ListView ?

我已经搜索过并找到 this但它似乎并不普遍实用!

最佳答案

RecyclerView 帮助了我(而不是水平 ListView ){thanX to @user2641570}。

根据documentation :

public LinearLayoutManager (Context context, int orientation, boolean reverseLayout)

Parameters context Current context, will be used to access resources.

orientation Layout orientation. Should be HORIZONTAL or VERTICAL.

reverseLayout When set to true, layouts from end to start.

所以我只是声明 LinearLayoutManager 如下:

LinearLayoutManager layoutManager = new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, true);

一切都很好。

关于Android - 如何创建从右到左的水平ListView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31263852/

相关文章:

android - 如何获取 ScrollView 的滚动量

android - 如何将 RecyclerView 与 NestedScrollView 一起使用?

fragment 示例中的 Android ListView

android - 清空 ListView,即使添加了项目

javascript - 如何在鼠标滚轮上进行水平滚动?

ios - iOS 中的双向滚动表

java - 使用 KeyGaurdManager 锁定 Android 确认凭据屏幕的方向

android - 如何通过 CURL 向所有设备发送 Firebase 通知?

android - 如何将一项 Activity 的输入转移到另一项 Activity ?

javascript - react 水平滚动菜单滚动错误