自适应图片各种尺寸 安卓程序开发中,如何让背景图片适应屏幕大小的改变。用Matrix具体实现的过程是什么?
安卓程序开发中,如何让背景图片适应屏幕大小的改变。用Matrix具体实现的过程是什么?通过public int screenWidth;public int screenHeight;WindowM
安卓程序开发中,如何让背景图片适应屏幕大小的改变。用Matrix具体实现的过程是什么?
通过public int screenWidth;public int screenHeight;WindowManager windowManager = getWindowManager() Display display = windowManager.getDefaultDisplay() screenWidth = display.getWidth() screenHeight = display.getHeight()得到屏幕的宽和高然后用Matrix方法里的缩放函数 把这两个值作为参数传进去 然后就可以实现让图片自适应屏幕大小了