Layout params of loaded view are ignored
I'm trying to write my own custom View and I have problem with LayoutParams . The idea is to extend ViewGroup ( LinearLayout ) public class MyView extends LinearLayout{ public MyView(Context context, AttributeSet attrs) { super(context, attrs); } public MyView(Context context) { super(context); } public void putContent(){ setOrientation(HORIZONTAL); LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); for (int i = 0; i < 5; i++){ View view = inflater.inflate(R.layout.item, null); TextView tv = (TextView)view.findViewById(R.id.item_text); tv