我有一个图形视图,我想重叠一些按钮。当我使用按钮创建一个笔尖并在添加图形后将其添加为子视图时,它只是在白色屏幕上显示按钮。如何在iOS上堆叠子视图?
GraphViewController *graphViewController = [[GraphViewController alloc] init];
[self.view addSubview:graphViewController.view];
GraphButtonViewController *graphButtonViewController = [[GraphButtonViewController alloc] initWithNibName:@"GraphButtonView" bundle:nil];
[self.view addSubview:graphButtonViewController.view];
那么GraphButtonView会保存按钮?那“GraphButton”将会在“GraphView”中?如果是这样,您可以简单地添加GraphButtonViewController.view作为图形视图的子视图 [graphViewController.view addSubview:graphButtonViewController.view]; – 2011-03-02 00:29:47