私は過去にこれを行うことができました。そこでは、特定のビューを開き、シミュレータが左に曲がり、その後に再びポートレートに戻ります。Obj-C、iphoneシミュレータをランドスケープにするにはどうすればいいですか?
私は景色を見ることができますが、私はそれを見るために頭を回転させる必要があります。
私はMoriatry piechartを試しています。
私が試したものを相続人viewWillAppear
CGRect myImageRect = CGRectMake(0.0f, 20.0f, 460.0f, 280.0f);
BNPieChart* chart = [[BNPieChart alloc] initWithFrame:myImageRect];
[chart addSlicePortion:0.1 withName:@"Orange 10%"];
[chart addSlicePortion:0.2 withName:@"Fandango 10%"];
[chart addSlicePortion:0.1 withName:@"Blue 10%"];
[chart addSlicePortion:0.1 withName:@"Cerulean 10%"];
[chart addSlicePortion:0.3 withName:@"Green 10%"];
[chart addSlicePortion:0.1 withName:@"Yellow 10%"];
[chart addSlicePortion:0.1 withName:@"Pink 10%"];
[self.view addSubview:chart];
で私が使用しているコードは、これらの....おそらく、私はそれらを正しく使用していないされています?シミュレータのiOSで
PieChartViewController *nextController = [[[PieChartViewController alloc]
initWithNibName:@"PieChartView" bundle:nil] autorelease];
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication]
delegate];
CGAffineTransform newTransform =
CGAffineTransformMake(0.0,1.0,-1.0,0.0,0.0,0.0);
nextController.view.transform = newTransform;
[nextController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[delegate.graphNavController pushViewController:nextController animated:YES];
そして、この..
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)
interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
そして...
- (void)viewDidLoad {
[super viewDidLoad];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:@"UIDeviceOrientationDidChangeNotification"
object:nil];
}
- (void) didRotate:(NSNotification *)notification {
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (orientation == UIDeviceOrientationLandscapeLeft ||
orientation == UIDeviceOrientationLandscapeRight) {
return;
}
}
シミュレータを回転するには、cmd +→およびcmd +←キーの組み合わせを使用します。 – Jasarien
はい、でもコードで行うことができます。私は持っていますが、もう一度それを適用することはできません。 – Jules
できれば驚いています。なぜあなたはしたいのですか? – gef