Hitomis / transferee

[暂停维护]一个帮助您完成从缩略视图到原视图无缝过渡转变的神奇框架
2.73k stars 389 forks source link

一个列表里边的item包含1-9个动态生成的ImgView #115

Closed LittlePenguinZ closed 4 years ago

LittlePenguinZ commented 4 years ago

一个RecyclerView列表里边的item包含1-9个动态生成的ImgView,是不是就不能用这个框架了,

Hitomis commented 4 years ago

描述的比较像微信朋友圈列表,每条朋友圈里面可能包含1-9张图片。 这种情形是可以用的。transferee 从第一个版本就可以这样用。

如果不是以上的情形,还请 post 图片或者视频,这样更加清晰明了哈

LittlePenguinZ commented 4 years ago

对,就是和朋友圈一样,是用bindRecyclerView这方式吗?,我试了bindImageView(imageView, listPath) 和bindRecyclerView 我弄了两次,总报错,求指点 谢谢

Hitomis commented 4 years ago

我想你是绑定错了RecyclerView。 是每个 item 里面的图片组被transferee绑定,而不是朋友圈这个 RecyclerView 被绑定。 如果猜想有误。请上代码。和报错日志

LittlePenguinZ commented 4 years ago

image 这是我的代码

LittlePenguinZ commented 4 years ago

image image 这是动态生成的ImageView的代码

LittlePenguinZ commented 4 years ago

image 错误

Hitomis commented 4 years ago

错误是数组下标越界。还是你的传参有问题,readme 中我对每个参数有非常详细的解释。 你要保证你的 position 不能超过 SourceImageLIst 的范围。

鉴于文字交流效率太低,我刚添加了朋友圈样式的使用demo。你可以查看下代码

WeChat1898f85da4c6ce6607b02c17ed1372b7
LittlePenguinZ commented 4 years ago

好的感谢

LittlePenguinZ commented 4 years ago

刚看了不太一样,你的图片是用RecyclerView 加载的,我的是在item里边自定义一个framelayout,然后再framelayout里边根据图片数量, 动态生成了1-9 的imgview

Hitomis commented 4 years ago

刚看了不太一样,你的图片是用RecyclerView 加载的,我的是在item里边自定义一个framelayout,然后再framelayout里边根据图片数量, 动态生成了1-9 的imgview

这不一样的道理吗?我的天。。不管你把你的容器换成 RecyclerView 还是你把api换成绑定ImageView,都是一样的可以操作的。代码都是换汤不换药的。。。 你可以仔细看看代码吧,把整个读懂。 demo 都写出来了。。这还搞不懂的话。我表示真的很绝望啊,兄弟