简体   繁体   English

如何水平制作列表视图

[英]How make listview horizontally

I'm confused about changing the vertical scroll listview to horizontal, I've looked for it in the forum, but nothing works, maybe someone can help, this is the script I found 我对将垂直滚动listview更改为水平感到困惑,我在论坛中一直在寻找它,但是没有任何效果,也许有人可以提供帮助,这是我找到的脚本

<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="0dp">

        <ListView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/lvList"
            android:layout_weight="1"/>

    </LinearLayout>

</HorizontalScrollView>

and it didn't work. 而且没有用 and this is my original script 这是我的原始剧本

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="0dp">

        <ListView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/lvList"
            android:layout_weight="1"/>

    </LinearLayout>

您可以将recyclerview与水平线性布局管理器一起使用。

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

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