I am working with layouts and I need some advice. I have to build this layout
and here is my code
This is my inflated layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_rounded_ingrid"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp">
<TextView
android:id="@+id/textview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="25sp"
android:layout_weight="1"
android:layout_marginRight="10dp"/>
<TextView
android:id="@+id/textviewClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:text="X"
android:textColor="@color/black"/>
</LinearLayout>
and this is the linearLayout
View view;
for (Modifier modifier: list){
view = View.inflate(mActivity,R.layout.inflated_layout,null);
((TextView)view.findViewById(R.id.textview)).setText(modifier.getTitle());
mDefaultIngridLayout.addView(view);
}
In result all inflated layout goes to in one line. What should I do here when added item into layout it goes to next line.