android-flowlayout
android-flowlayout copied to clipboard
When RecyclerView layout_height set to wrap_content, there will be nothing show on the screen.
in FlowLayoutManager
this.config.setMaxWidth(this.getWidth() - this.getPaddingRight() - this.getPaddingLeft()); this.config.setMaxHeight(this.getHeight() - this.getPaddingTop() - this.getPaddingBottom()); this.config.setWidthMode(View.MeasureSpec.EXACTLY); this.config.setHeightMode(View.MeasureSpec.EXACTLY); this.config.setCheckCanFit(true);
setMaxHeight always get 0.
And when i set a exactly height in xml, the content can not scroll when the recyclerview is bigger than its parent.
Can you please tell how to solve this?
Thank you very much.
Same thing here
[SOLUTION ]
Hey, I had the same problem @pzhangleo @XanthusL, solved it by putting setAutoMeasureEnabled(true) in the constructor of the FlowLayoutManager, i.e.
public FlowLayoutManager() { this.config = new ConfigDefinition(); setAutoMeasureEnabled(true); }
Hopefully this can help someone else stuck on this as well, it's a relatively simple solution!
@BrandonJF I added setAutoMeasureEnabled(true) in the FlowLayoutManager's constructor... It still isn't working... Can you elaborate a li'l more over this..