iPhone中使用popover功能
2016-03-04 16:43
686 查看
popover功能最早出现在iPad中
这样可在iPhone中实现popover功能
- (IBAction)btnClicked:(id)sender { PopTableViewController *pop = [[PopTableViewController alloc]init];//popover出来的控制器 pop.preferredContentSize = CGSizeMake(100, 100);//popover出来的控制器的尺寸 pop.modalPresentationStyle = UIModalPresentationPopover;//显示方式 UIPopoverPresentationController *popover = pop.popoverPresentationController; popover.delegate = self;//遵循UIPopoverPresentationControllerDelegate popover.barButtonItem = self.navigationItem.rightBarButtonItem; popover.permittedArrowDirections = UIPopoverArrowDirectionAny; [self presentViewController:pop animated:YES completion:nil]; } #pragma mark - UIPopoverPresentationControllerDelegate代理方法 - (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller{ return UIModalPresentationNone; }
这样可在iPhone中实现popover功能
相关文章推荐
- 绝大部分 Android 手电筒应用需要大量权限
- 这些看似合法的 iPhone Lightning 数据线将劫持您的电脑
- 每日安全资讯:NSO,一家专业入侵 iPhone 的神秘公司
- 我的iPhone桌面
- 三种检测iPhone/iPad设备方向的方法
- js实现iPhone界面风格的单选框和复选框按钮实例
- javascript实现根据iphone屏幕方向调用不同样式表的方法
- android Gallery组件实现的iPhone图片滑动效果实例
- Android仿iphone自定义滚动选择器
- js判断手机端(Android手机还是iPhone手机)
- 使用Objective-C获取IPHONE手机IMSI序列号
- 探讨Android 的屏幕滚动操作不如 iPhone 流畅顺滑的原因
- iphone的safari浏览器中实现全屏浏览的方法
- 禁止iPhone Safari video标签视频自动全屏的办法
- Object-c Archiving归档
- 西蒙iphone-OpenGL ES教程英文原帖地址以及实例代码
- [开源项目]开心英语8000句 Iphone+Ipad版
- 月光微博客