private void stretchViewVertically(View view,int crossSize){
  LayoutParams lp=(LayoutParams)view.getLayoutParams();
  int newHeight=crossSize - lp.topMargin - lp.bottomMargin;
  newHeight=Math.max(newHeight,0);
  view.measure(MeasureSpec.makeMeasureSpec(view.getMeasuredWidth(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(newHeight,MeasureSpec.EXACTLY));
}

private void stretchViewVertically ( View view , int crossSize ) { LayoutParams lp = ( LayoutParams ) view . getLayoutParams ( ) ; int newHeight = crossSize - lp . topMargin - lp . bottomMargin ; newHeight = Math . max ( newHeight , 0 ) ; view . measure ( MeasureSpec . makeMeasureSpec ( view . getMeasuredWidth ( ) , MeasureSpec . EXACTLY ) , MeasureSpec . makeMeasureSpec ( newHeight , MeasureSpec . EXACTLY ) ) ; }
expand the view vertically to the size of the crosssize ( considering the view margins )
