recyclerView版本高于v7:23.1.1的项目



高于v7.23.1.1的recyclerView中的每个项目都单独显示。这意味着在搜寻的时候,每一个下一个都在旁边。

<android.support.v7.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/listView2"
    android:background="#f7f7f7"
    android:layout_above="@+id/seekBar"
    android:layout_below="@+id/toggleVolume"
    android:layout_alignRight="@+id/seekBarInfoText"
    android:layout_alignEnd="@+id/seekBarInfoText"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="false"
    android:elevation="@dimen/abc_text_size_medium_material" />

我的建筑.gradle

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
    compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.3'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'net.htmlparser.jericho:jericho-html:3.3'
    compile 'com.mcxiaoke.volley:library:1.0.19'
}

有什么建议吗?

在此处输入图像描述

SupportLibrary的23.2版本为RecyclerView引入了一项新功能,即自动测量,允许RecyclerView根据其内容的大小来调整大小。这意味着以前不可用的场景,例如对RecyclerView的维度使用WRAP_CONTENT,现在是可能的。

因此,发行说明中有一条警告,请检查您的RecyclerView项目视图。

由于此更改,请确保仔细检查项目视图的布局参数:以前忽略的布局参数(如滚动方向上的MATCH_PARENT)现在将完全遵循。

查看这是否是您的问题,并查看此处了解更多信息:http://android-developers.blogspot.com.eg/2016/02/android-support-library-232.html

最新更新