下面的代码生成一个按钮并将其放置在屏幕上;
button = [UIButton allow] initWithFrame:CGRectMake(0.0, 0.0, 20.0, 20.0)]; button.frame = CGRectMake(0.0, 20.0, 10.0, 40.0); button.backgroundColor = [UIColor redColor]; [self.window addSubview:button];
但是,当我通过“pushViewController:animated”生成一个新屏幕以覆盖当前屏幕时,按钮会在新屏幕周围浮动。但是通过界面生成器附加到旧屏幕的所有其他内容都会以正确的方式消失在新屏幕后面。
那么,我做错了什么?
谢谢,