PictureSelector
PictureSelector copied to clipboard
图片列表 item 宽高动态设置而不是默认的200
Current use version?
当前使用的版本是多少?
api 27 - 32
Will this problem occur in demo?
Demo能否复现这问题?
可以
Describe the problem or provide an error log?
描述问题或提供错误log?
现在图片列表单张图片宽高默认为200,有的设备,例如平板上显示的时候会很模糊,
是否可以根据设备尺寸动态设置呢?
我给出的方案为:
`val wm = mContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
if(width == 0){
width = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
val size = Point()
wm.defaultDisplay.getSize(size)
size.x /4
} else {
wm.defaultDisplay.width / 4
}
}`
这里的 4 表示单行显示的图片个数