下面是iOS里面做全屏Dialog的代码。
调用show时Dialog会覆盖当前的controller,全屏显示。可以用来做蒙板效果。
欢迎转载,转载请注明出处, http://blog.csdn.net/tadican/article/details/7999493 .
@interface Dialog: UIViewController
{
UIWindow * dialog;
}
@end
@implementation Dialog
- (void)show
{
CGRect screenBounds = [[UIScreen mainScreen] bounds];
dialog = [[UIWindow alloc] initWithFrame:screenBounds];
dialog.rootViewController = self;
[dialog makeKeyAndVisible];
}
-(void)close{
// Exit this page.
[self removeFromParentViewController];
[dialog release];
}
@end