Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

反馈个问题 #3

Open
dakexuan opened this issue Apr 3, 2023 · 7 comments
Open

反馈个问题 #3

dakexuan opened this issue Apr 3, 2023 · 7 comments

Comments

@dakexuan
Copy link

dakexuan commented Apr 3, 2023

将RecyclerView宽度设置wrap_content,item内容也设置wrap_content,总之就是,宽度不要占满屏幕,设置列为5,总数据条数是6,这时候最右边的item就会多出一点点间距

@huangxiaolianghh
Copy link
Owner

将RecyclerView宽度设置wrap_content,item内容也设置wrap_content,总之就是,宽度不要占满屏幕,设置列为5,总数据条数是6,这时候最右边的item就会多出一点点间距

你的意思是设置了setIncludeEdge(false),第六个item右边还是出现了边距?

@dakexuan
Copy link
Author

dakexuan commented Apr 3, 2023

设置了setIncludeEdge(false),第五个item右边出现了边距,这个可以直接拿这个项目试出来(你那边试试看会不会)。实际上我真正去用的时候,只有两个item的时候(设置列=2),也出现了这个问题

@huangxiaolianghh
Copy link
Owner

设置了setIncludeEdge(false),第五个item右边出现了边距,这个可以直接拿这个项目试出来(你那边试试看会不会)。实际上我真正去用的时候,只有两个item的时候(设置列=2),也出现了这个问题

好像不会呀,设置了wrap_content,demo那五个item的宽度并没有比屏幕宽度长,所以才会有空隙。如果一行的item超过了屏幕宽度,就是铺满自适应的。同理你的项目设置列为2的时候,是不是这两个item不足以铺满屏幕宽度?如果你要铺满屏幕设置match_parent就好了。

@dakexuan
Copy link
Author

dakexuan commented Apr 3, 2023

Uploading Screenshot_2023-04-03-15-18-17-66_09edba56d3966727ed101a548d5209b7.jpg…
不知道能不能看到图片

@huangxiaolianghh
Copy link
Owner

看不到照片,demo可以实践刚才我说的几点

@dakexuan
Copy link
Author

dakexuan commented Apr 3, 2023

Screenshot_2023-04-03-15-18-17-66_09edba56d3966727ed101a548d5209b7
右侧多了一丢丢红色间距,第三个item右侧多了一丢丢白色的间距

@huangxiaolianghh
Copy link
Owner

Screenshot_2023-04-03-15-18-17-66_09edba56d3966727ed101a548d5209b7 右侧多了一丢丢红色间距,第三个item右侧多了一丢丢白色的间距

哦哦,我懂了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants