private void generateView() {
for (int i = 0; i < 10; i++) {
mview = new LinearLayout(getActivity());
mview.setBackgroundResource(R.color.grayColor);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(10, 40);
layoutParams.setMargins(5, 0, 5, 0);
mview.setLayoutParams(layoutParams);
lnLinearlayout.addView(mview);
}
}
Using this code I am able to display views like this:
||||||||||
I want to increase the height of the views at position 4 and 8. I am trying to do so using:
lnLinearlayout.getChildAt(4).setMinimumHeight(20) lnLinearlayout.getChildAt(8).setMinimumHeight(20)
but there is no change in the views. Can anyone please suggest how to increase the height of a particular view?