android - 如何在 Android Studio 的 recyclerview 预览中指定列表项计数?

标签 android android-layout android-studio android-tools-namespace

recyclerview 布局定义为

     <android.support.v7.widget.RecyclerView
            android:layout_marginTop="15dp"
            android:id="@+id/call_detail_list"
            android:scrollbars="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:listitem="@layout/call_item"
            />

在预览中,我可以看到指定布局的列表项, 但是项目数是10。有什么办法可以改变吗?

最佳答案

试试这个(3个项目)

tools:itemCount="3"

关于android - 如何在 Android Studio 的 recyclerview 预览中指定列表项计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41776286/

相关文章:

android - FragmentManager 已经在 commitAllowingStateLoss() 上执行事务

android - Eclipse 中的华硕 Epad 模拟器

android - 如何使用 AppCompat 设置 FloatingActionButton 的颜色

android - Android 中表格行项目的边框

android-studio - 使用 Gradle 在 Android Studio 中出现 UnsatisfiedLinkError

android - TTS 的默认音频流是什么?

java - 致命异常 - OutOfMemoryError

java - 在创建 fragment 时使用 ConstraintLayout

android-studio - Android Studio 上已存在名为 'app' 的模块

Android studio - 如何为不同风格创建 res 文件夹