大佬教程收集整理的这篇文章主要介绍了objective-c – UISplitViewController:如何呈现popover?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
当iPad在PorTrait中启动时,我希望可以看到SplitView中的Popover.我怎样才能做到这一点?
- (void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc { //setTing the barButtonItem in the toolbar in the detail view. [pc presentPopoverFromBarButtonItem:barButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; }
- (void)viewDidAppear:(BOOL)animated { if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPorTrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPorTraitUpsideDown) { if (self.view.window != nil) { [_masterPopoverController presentPopoverFromRect:CGRectMake(0,1,1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO]; } } [super viewDidAppear:animated]; }
和
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { if (fromInterfaceOrientation == UIDeviceOrientationLandscapeLeft || fromInterfaceOrientation == UIDeviceOrientationLandscapeRight) { if (self.view.window != nil) { [_masterPopoverController presentPopoverFromRect:CGRectMake(0,1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO]; } } }
以上是大佬教程为你收集整理的objective-c – UISplitViewController:如何呈现popover?全部内容,希望文章能够帮你解决objective-c – UISplitViewController:如何呈现popover?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。