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

Buttons are not adding as per the Flow layout behaviour #34

Open
venkymsnv opened this issue Aug 13, 2016 · 0 comments
Open

Buttons are not adding as per the Flow layout behaviour #34

venkymsnv opened this issue Aug 13, 2016 · 0 comments

Comments

@venkymsnv
Copy link

I used Flowlayout in my application. Below is my code

<com.wefika.flowlayout.FlowLayout android:id="@+id/flow" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" />

then I adding the childview as buttons dynamically.Below is the code
`FlowLayout ll = (FlowLayout)layout.findViewById(R.id.flow);
for (int i = 0; i <= btnList.size; i++) {

          final Button btnTag = new Button(MainActivity.this); 
         btnTag.setId(3000 + i);
        FlowLayout.LayoutParams layoutParams = new FlowLayout.LayoutParams(
               FlowLayout.LayoutParams.WRAP_CONTENT,FlowLayout.LayoutParams.WRAP_CONTENT);
          layoutParams.setMargins(7,7,7,7);
          btnTag.setTextColor(Color.BLACK);

          btnTag.setText("#"+btnList.get(i).toString());
          ll.addView(btnTag,layoutParams)
      }`
  1. Button width is not changing dynamically as per the text
  2. How to decrease Padding between button border and its text.
    How to resolve the above issues?
    Below is my screenshot
    screenshot_2016-08-13-19-33-09
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

1 participant