public void setViewHeight ( int newHeight ) { if ( newHeight > 0 ) { originalHeight = newHeight ; RelativeLayout . LayoutParams layoutParams = ( RelativeLayout . LayoutParams ) view . getLayoutParams ( ) ; layoutParams . height = newHeight ; view . setLayoutParams ( layoutParams ) ; } }
Change view height using the LayoutParams of the view .