How to use Storyboard to make popover that can be used in code?

后端 未结 5 2014
小鲜肉
小鲜肉 2020-12-24 03:56

I\'m building a collection of forms each of which contains several fields. Some of the fields are UITextFields that will display a date. I\'ve created a new cla

5条回答
  •  情歌与酒
    2020-12-24 04:34

    - (IBAction)pressItemChooseOprateRoom:(id)sender {
        if (isPad){
            // UIView *anchor = sender;
            UIViewController *viewControllerForPopover =
            [self.storyboard instantiateViewControllerWithIdentifier:@"OperateRoomList"];
    
            _myPopover = [[UIPopoverController alloc]
                          initWithContentViewController:viewControllerForPopover];
    
            CGRect rc=[self getBarItemRc:sender];
            [_myPopover presentPopoverFromRect:rc
                                        inView:self.view
                      permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    
            [MLControl shared].popover =self;
            // [self perfformSegueWithIdentifier:SEGUE_POP_OPERATEROOM sender:self];
        }else{
            [self iphoneOpenOperateRoomList];
            /* [self performSegueWithIdentifier:@"iPhonePushOperateRoom" sender:self];
             */
        }
    }
    
    -(void)iphoneOpenOperateRoomList{
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"OperateRoomList"];
        //        if (!index.showTabBar) {
        //            vc.hidesBottomBarWhenPushed = YES;
        //        }
    
        [self.navigationController pushViewController:vc animated:YES];
    }
    

提交回复
热议问题