Android recylerview v.23.2.0 & design library v.23.2.0 are broken

China☆狼群 提交于 2019-12-03 09:26:03

The reason you are getting large open spaces is because of match_parent. It wasn't working correctly before, but now with the new release it is working differently. You just need to update to wrap_content instead of match_parent as that causes the layout to match the parent giving you the large spaces.

The RecyclerView widget provides an advanced and flexible base for creating lists and grids as well as supporting animations. This release brings an exciting new feature to the LayoutManager API: auto-measurement! This allows a RecyclerView to size itself based on the size of its contents. This means that previously unavailable scenarios, such as using WRAP_CONTENT for a dimension of the RecyclerView, are now possible. You’ll find all built in LayoutManagers now support auto-measurement.

http://android-developers.blogspot.co.uk/2016/02/android-support-library-232.html

It seems that two new libraries, support-vector-drawable and support-animated-vector-drawable, are required, because appcompat-v7 uses vector drawables (Issue discussion). Just update your build.gradle with the following for adding in support for vector drawables and the problem with black icons will be solved.

build.gradle

Add following lines to your build gradle base on your gradle plugin version

// Gradle Plugin 2.0+

 android {  
   defaultConfig {  
     vectorDrawables.useSupportLibrary = true  
    }  
 }   

// Gradle Plugin 1.5

 android {  
   defaultConfig {  
     generatedDensities = []  
  }  

  // This is handled for you by the 2.0+ Gradle Plugin  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
 } 

UPDATE For AppCompat users, the flags for enabling support vector drawables described in the 23.2 blog post are no longer required for usage of AppCompat 23.2.1. However, you can still take advantage of the app:srcCompat attribute if you wish to use support vector drawables for your own resources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!