Skip to content

All the child items in Recycler view touching with each other. margin property does not work #18

@anbarasu-seven

Description

@anbarasu-seven

CHILD ITEM LAYOUT

     <?xml version="1.0" encoding="utf-8"?>
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:id="@+id/clickableLable"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:background="@drawable/rounded_label_un_selected">

     <TextView xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/label_text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center_vertical"
          android:padding="5dp"
          android:text="Chennai"
          android:textColor="#515151"
          android:textSize="14sp"
          android:textStyle="normal" />
        </LinearLayout>

IN MY ACTIVITY

    RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
    FlowLayoutManager flowLayoutManager = new FlowLayoutManager();
    flowLayoutManager.setAutoMeasureEnabled(true);
    rv.setLayoutManager(flowLayoutManager);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions