Wednesday, 27 February 2013

How to know that the volume slider is vertical or horizontal and also transform view.


CGAffineTransform verticalTrans = CGAffineTransformMakeRotation(M_PI * 0.5);    CGAffineTransform horizontalTrans = CGAffineTransformMakeRotation(0);    if(!CGAffineTransformEqualToTransform(slider_answer.transform, verticalTrans))    
{           
slider_answer.transform = verticalTrans;        
slider_answer.frame=CGRectMake(60, 55, 40, 140);
// if coming view is not vertical we transform into vertical    
}   
else if (!CGAffineTransformEqualToTransform(slider_answer.transform, horizontalTrans))   
 {               
slider_answer.transform = horizontalTrans;       
slider_answer.frame=CGRectMake(30, 45, 120, 40);
// if coming one is not horizontal we change into horizontal  
  }