我有这个代码在full.view中全屏创建UIView,但我需要在一个单独的子视图中创建
我该怎么办?
File .h
@private
NGLMesh *_cube1;
NGLCamera *_camera;
}
File .m
- (void) drawView
{
[_camera drawCamera];
}
- (void) loadView
{
// Following the UIKit specifications, this method should not call the super.
// Creates the NGLView manually (without XIB), with the screen's size and sets its delegate.
NGLView *nglView = [[NGLView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
nglView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
nglView.delegate = self;
// Sets the NGLView as the root view of this View Controller hierarchy.
self.view = nglView;
[nglView release];
}
- (void) viewDidLoad
{
[super viewDidLoad];
// Setting up the multiple touch for this view.
self.view.multipleTouchEnabled = YES;
NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
kNGLMeshCentralizeYes, kNGLMeshKeyCentralize,
@"0.3", kNGLMeshKeyNormalize,
nil];
_cube1 = [[NGLMesh alloc] initWithFile:@"cube.obj" settings:settings delegate:nil];
}