yanyusong / Y_DividerItemDecoration

A common RecyclerView divider , supports the LinearLayoutManager and the GridLayoutManager.
https://juejin.im/post/5940a020a0bb9f006b734228
Apache License 2.0
378 stars 56 forks source link

不能使用px #6

Open EthanCo opened 6 years ago

EthanCo commented 6 years ago

使用dp分割线太粗了,希望可以使用px作为单位

yanyusong commented 6 years ago

嗯,用dp的话是可以支持float类型的,可以使用比如:0.5dp、0.3dp等,在不同分辨率的屏幕上渲染时系统会根据dp和px的转化系数,自动选择最相近的整数px值,会有相对一致的体验。假如用px的话,可能就不能保证这种适配性了。假如你想用1px的话,你可以用0.5dp或者0.4dp来代替,可能会有相同的效果

EthanCo commented 6 years ago

似乎不行,使用LinearLayoutManager的时候,小于1dp,比如0.3dp,分割线就直接不显示了。