aha progress but still struggling
Ahah, i found that if you just assign the transform to a view it doesn't seem to do anything.
so myview.transform = mytransform
is a NOP
but [myview setTransform:mytransform]
does do something.
But just rotating the view from portrait to landscape screws up the coordinates,
so you need to offset by half of the difference:
// this will transform your coordinates so that you can draw kind of normally
CGAffineTransform rotate = CGAffineTransformMakeRotation(1.57079633);
rotate = CGAffineTransformTranslate (rotate, -80.0, +80.0);
[myView setTransform:rotate];
Now I can add buttons in a convenient coordinate system.
However my view background is now shifted -80, +80 pixels, because of the translation I added to the view. How can i load a background into the view without getting fouled up by my transform?
I have a view background (currently stored as landscape):
UIImageView *myviewback = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"back_spreads.png"]];
[self addSubview:myviewback];
My background gets rotated as the transform indicates, but the translation
i put in to fix the coordinates fouls up the background, how do I fix this?
|