shenbengit / PagerGridLayoutManager

基于RecyclerView实现网格分页LayoutManager——PagerGridLayoutManager
MIT License
244 stars 26 forks source link

在viewpager中用rv的父布局是RelativeLayout的话会报RecyclerView's width and height must be exactly #14

Closed qq517103430 closed 2 years ago

qq517103430 commented 2 years ago

在viewpager中用rv的父布局是RelativeLayout的话会报RecyclerView's width and height must be exactly

shenbengit commented 2 years ago

RecyclerView的宽高度需要指定。

qq517103430 commented 2 years ago

指定了啊,你直接用你demo里viewpageractivity那个,把第一个fragment里的根布局由LinearLayout改成RelativeLayout就能复现

shenbengit commented 2 years ago

image 读一下RelativeLayout源码就好了,这个是源码决定的,目前的本框架的局限性还无法解决这个问题,或者使用ConstraintLayout代替RelativeLayout。

shenbengit commented 1 year ago

v1.1.8 做了兼容处理