开发者

In Cocoa-Touch Framework, is there any modal view in iPad like this?

开发者 https://www.devze.com 2023-04-10 09:21 出处:网络
Is there any model view 开发者_开发百科like this on the iPad? Yes, there is: UIModalPresentationFormSheet

Is there any model view 开发者_开发百科like this on the iPad?

In Cocoa-Touch Framework, is there any modal view in iPad like this?


Yes, there is:

UIModalPresentationFormSheet

The width and height of the presented view are smaller than those of the screen and the view is centered on the screen. If the device is in a landscape orientation and the keyboard is visible, the position of the view is adjusted upward so that the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.

For example:

UIViewController *viewController = [[UIViewController alloc] init];
viewController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:viewController animated:YES];
viewController.view.superview.frame = CGRectMake(0, 0, 540, 500); // this is important to do this after presentModalView
viewController.view.superview.center = self.view.superview.center;
0

精彩评论

暂无评论...
验证码 换一张
取 消