Get color from wallpaper? - Android(从壁纸中获取颜色?- 安卓)
问题描述
如何找到当前壁纸的(平均)颜色并将该颜色设置为我的小部件上的布局?
How can I find the (Average) color of the current wallpaper and set that color to a layout on my widget?
我正在尝试做的一个例子:
An example of what I'm trying to do:
这是 AccuWeather 上的设置:
This is a setting on AccuWeather:
推荐答案
你可以使用WallpaperManager.getWallpaperColors 在 API 27 中添加
You can use WallpaperManager.getWallpaperColors that was added in API 27
这篇关于从壁纸中获取颜色?- 安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从壁纸中获取颜色?- 安卓
				
        
 
            
        基础教程推荐
- 不推荐使用 Api 注释的描述 2022-01-01
 - 多个组件的复杂布局 2022-01-01
 - 验证是否调用了所有 getter 方法 2022-01-01
 - Java Swing计时器未清除 2022-01-01
 - 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
 - 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
 - 大摇大摆的枚举 2022-01-01
 - Java 实例变量在两个语句中声明和初始化 2022-01-01
 - 在 Java 中创建日期的正确方法是什么? 2022-01-01
 - 从 python 访问 JVM 2022-01-01
 
    	
    	
    	
    	
    	
    	
    	
    	
						
						
						
						
						
				
				
				
				