読者です 読者をやめる 読者になる 読者になる

24/7 twenty-four seven

iOS/OS X application programing topics.

UIImageViewを使って画像を回転

iPhone Objective-C Cocoa
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationIsLandscape(orientation)) {
	[landscapeClockView setCenter:CGPointMake(160.0, 240.0)];
	if (orientation == UIDeviceOrientationLandscapeLeft) {
		[landscapeClockView setTransform:CGAffineTransformMakeRotation(M_PI / 2.0)];
	} else {
		[landscapeClockView setTransform:CGAffineTransformMakeRotation(M_PI / -2.0)];
	}