views:

48

answers:

1

Hi guys,

In my code I have a table, and in my table I have a slider which I transform so that it is vertical.

metricSlider.transform = CGAffineTransformRotate(metricSlider.transform, 270.0/180*M_PI);

But every time the code gets called to draw the slider, it of course applies the transform on top of the previously applied transform.

Instead of metricSlider.transform is there some default value I can use to tell it to apply it from the original position so that its only ever transformed once?

I could just add a bool to track if it was transformed and set and reset the bool as needed, but this could allow bugs eventually and make the code harder to follow in the future.

Is there a better solution?

Many Thanks -Code

A: 

Try:

metricSlider.transform = CGAffineTransformMakeRotation( 270.0/180*M_PI );

Or you can transform identity transformation (CGAffineTransformIdentity)

metricSlider.transform = CGAffineTransformRotate(CGAffineTransformIdentity, 270.0/180*M_PI);
Vladimir
dropoffTextField = [self newTextField]; worked! Thanks Vladimir
Code