我想你可能需要重新进入你的中心:
// Set the center point of the view to the center point of the window's content area. self.view.center = CGPointMake(160.0, 240.0);
这是我用于横向视图的整个init方法,并且没有问题.只需确保将笔尖设置为正确的尺寸.
// Implement viewDidLoad to do additional setup after loading the view. - (void)viewDidLoad { [super viewDidLoad]; // Rotate to landscape self.view.frame = CGRectMake(0, 0, 480.0, 320.0); if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeRight) { CGAffineTransform transform = self.view.transform; // Set the center point of the view to the center point of the window's content area. self.view.center = CGPointMake(160.0, 240.0); // Rotate the view 90 degrees around its new center point. transform = CGAffineTransformRotate(transform, (M_PI / 2.0)); self.view.transform = transform; } }