iOS中之前的PopoverView实现下拉菜单,PopoverView已经被废弃,现在用什么写
本文介绍了iOS中之前的PopoverView实现下拉菜单,PopoverView已经被废弃,现在用什么写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
iOS中之前的PopoverView实现下拉菜单,PopoverView已经被废弃,现在用什么写
解决方案
你说的应该是 UIPopoverController 吧,如果是的话,你可以用下面的方案替换 UIPopoverController:
1、present 一个 VC 时,用 UIModalPresentationPopover 这种样式,代码大致如下:
UIViewController *modalVC = [[UIViewController alloc] init];
modalVC.modalPresentationStyle = UIModalPresentationPopover;
modalVC.popoverPresentationController.sourceView = self.view;
[self presentViewController:modalVC animated:YES completion:nil];
2、使用 UIPopoverPresentationController。
希望对你有用。
这篇关于iOS中之前的PopoverView实现下拉菜单,PopoverView已经被废弃,现在用什么写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文