Android Support Library 23.2 vector drawables are blurry

前端 未结 2 2024
半阙折子戏
半阙折子戏 2020-12-17 16:32

The latest version of the Android Support Library (23.2) adds support for vector drawables. It appears to do this by rasterizing the vectors on the fly on platforms that don

2条回答
  •  失恋的感觉
    2020-12-17 17:05

    the vector is rasterized at 16dp and resized to 128dp

    up to 23.1, Android was creating raster images starting from the provided VectorDrawable. This thing changed in v23.2 of the support library. This behavior happens if you set up correctly your build.gradle .

    If you are using the Gradle Plugin 2.0+, add

    android {  
       defaultConfig {  
         vectorDrawables.useSupportLibrary = true  
        }  
     } 
    

    if you are using 1.5.0

     android {  
       defaultConfig {  
         generatedDensities = []  
      }  
    
      // This is handled for you by the 2.0+ Gradle Plugin  
      aaptOptions {  
        additionalParameters "--no-version-vectors"  
      }  
     } 
    

    after you sync, clean your workspace and build again. You can read more about it here and here

提交回复
热议问题