我需要在一个窗口中添加更多数量的 NSView 以及更多数量的自定义 NSOpenGLView,然后想要对视图数组进行洗牌。如果我最初设置基本视图 setWantsLayer:YES,如果我设置 setWantsLayer:NO,我将无法绘制 OpenGLView,我可以绘制 OpenGLView 但 NSView 超出了 OpenGLView。喜欢,
在 MyOpenGLView.m
myOpenGLView = [ [ MyOpenGLView alloc ] initWithFrame:frame_ colorBits:16 depthBits:16 fullscreen:FALSE ];
[self addSubview: myOpenGLView];
然后我尝试在窗口上再添加一个视图
customView = [[CustomView alloc] initWithFrame:[self bounds]];
[self addSubview:customView];
现在我的自定义视图超越了 myOpenGLView。我该如何解决?
编辑:
问题截图