0
我想知道如何將橫向視圖設置爲橫向模式。ARToolkit,如何在橫向模式下設置視圖
NSLog(@"bound %@",NSStringFromCGRect([self.view bounds]));
NSLog(@"bound %@",NSStringFromCGRect([[UIScreen mainScreen] bounds]));
glView = [[ARView alloc] initWithFrame:[[self view] bounds] pixelFormat:kEAGLColorFormatRGBA8 depthFormat:GL_DEPTH_COMPONENT16_OES stencilFormat:0 preserveBackbuffer:NO];
glView.arViewController = self;
self.view = glView;
UIToolbar *toolbar = [[UIToolbar alloc] init];
toolbar.frame = CGRectMake(0, 255, 480, 44);
toolbar.barStyle = UIBarStyleBlack;
NSMutableArray *items = [[NSMutableArray alloc] init];
[items addObject:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(stopAR:)] autorelease]];
[toolbar setItems:items animated:NO];
[items release];
[self.view addSubview:toolbar];
[toolbar release];
試圖設置這一點,但沒有效果
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
[super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
任何想法如何在疊加視圖中添加? – Desmond 2012-02-15 10:52:47
通過向ARView添加子視圖來添加覆蓋視圖 – Mark 2012-05-31 12:12:42