private void stretchViewHorizontally(View view,int crossSize){
  LayoutParams lp=(LayoutParams)view.getLayoutParams();
  int newWidth=crossSize - lp.leftMargin - lp.rightMargin;
  newWidth=Math.max(newWidth,0);
  view.measure(MeasureSpec.makeMeasureSpec(newWidth,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(view.getMeasuredHeight(),MeasureSpec.EXACTLY));
}

private void stretchViewHorizontally ( View view , int crossSize ) { LayoutParams lp = ( LayoutParams ) view . getLayoutParams ( ) ; int newWidth = crossSize - lp . leftMargin - lp . rightMargin ; newWidth = Math . max ( newWidth , 0 ) ; view . measure ( MeasureSpec . makeMeasureSpec ( newWidth , MeasureSpec . EXACTLY ) , MeasureSpec . makeMeasureSpec ( view . getMeasuredHeight ( ) , MeasureSpec . EXACTLY ) ) ; }
expand the view horizontally to the size of the crosssize ( considering the view margins )
