It may be too late but for the sake of others who have the same problem, to set the height of the ImageView
:
imageView.getLayoutParams().height = 20;
Important. If you're setting the height after the layout has already been 'laid out', make sure you also call:
imageView.requestLayout();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…