如何在AppDeleGate.m上添加按钮或画面(view)

来源:互联网 发布:高博软件技术学院 编辑:程序博客网 时间:2024/06/08 04:52

一般是不允许在AppdeleGate上添加view的,如果要在上面添加视图或按钮也是可以的

example:

      

UIButton *btn=[UIButton buttonWithType:UIButtonRoundRect];

[btn setTitle:@"click me " forState:UIControlStateNormal ];

[btn setFrame:CGRectMake(100,100,40,25)];[self.window insertSubview:btn atIndex:0];

 [self.windowmakeKeyAndVisible];

运行之后就可以在window上看到一个按钮了。

原创粉丝点击