gpt4 book ai didi

Android 设计布局 ListItem RecyclerView Horizo​​ntal

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:49:52 24 4
gpt4 key购买 nike

我正在使用 tools:listitem 属性通过 recyclerview 在设计布局中显示我的 View 。问题是,它们总是出现在垂直列表中。有没有办法让设计布局编辑器水平显示它们?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@android:layout/simple_list_item_checked"/>

enter image description here

我想要上面的图像,水平显示。在设计 View 中。不在应用程序本身,我知道该怎么做。

最佳答案

请检查此代码

   <android.support.v7.widget.RecyclerView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />

关于Android 设计布局 ListItem RecyclerView Horizo​​ntal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38757538/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com