如何完全像这样呈现 View Controller 。我的意思是前面的密码 View 。
我知道如何创建 View ,但不知道如何呈现它。
最佳答案
我使用 UIPopoverController
实现了这样的屏幕.像这样的东西:
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:content];
UIView *root = [UIApplication sharedApplication].keyWindow;
CGRect frame = root.frame;
frame.origin = CGRectCenter(frame);
frame.size = CGSizeMake(1, 1);
[popover presentPopoverFromRect:frame inView:root permittedArrowDirections:0 animated:YES];
框架是屏幕的中心点。为箭头方向传递 0 可防止通常的箭头出现在弹出框上。
content
是您希望显示的 View Controller 。
关于objective-c - 如何呈现完全一样的 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13444194/