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

failed to set margins in between two items of flow layout its displaying continuously with no margins , padding ? #70

Open
erum-hannan-10p opened this issue Jan 14, 2016 · 4 comments

Comments

@erum-hannan-10p
Copy link

<org.apmem.tools.layouts.FlowLayout
android:id="@+id/flowlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:layout_below="@+id/relLayoutSpinner">
</org.apmem.tools.layouts.FlowLayout>




@PalakSDarji
Copy link

any solution??

@pgomesrm
Copy link

pgomesrm commented Nov 7, 2016

I'm adding margins programmatically to the FlowLayout children's and it's not working.

final FlowLayout layout = new FlowLayout(this);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
params.setMargins(20, 20, 20, 0);

//Creating TextView
TextView txt = new TextView(this);
txt.setText("test");
layout.addView(txt, params);

Any solution?

@buneme
Copy link

buneme commented Mar 17, 2017

You need to use FlowLayout.LayoutParams
Like this:
FlowLayout.LayoutParams params = new FlowLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

@antur123
Copy link

antur123 commented Feb 7, 2018

Using FlowLayout.LayourParams did the trick for me! I was using LinearLayout.LayoutParms too and it didn't work. Thanks!

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

5 participants