android dynamically add layouts under each other
问题 I'm trying to add multiple layouts dynamically under each other. So I wrote the following code: for (int i = 1; i <= layoutCounter; i++) { View neu = inflater.inflate(R.layout.vote, parent, false); neu.setId(layoutID); if (layoutID == 1) { params = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.BELOW, R.id.txtMultiline); } else { params = new RelativeLayout.LayoutParams( RelativeLayout