-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
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)
}`
Metadata
Metadata
Assignees
Labels
No labels
