【问题标题】:Popover not showing the view弹出窗口不显示视图
【发布时间】:2012-11-30 07:06:33
【问题描述】:

我正在使用UIPopoverController

在这个弹出窗口中,我正在加载一个自定义视图,它有一个导航栏和一个表格视图。 当我呈现弹出框时,它只显示导航栏并且不显示表格视图。 请告诉我如何解决这个问题。

【问题讨论】:

  • 尝试self.myPopoverController.doWhatImThinkingAndNotWhatTheCodeSays = YES; 发布一些相关代码。

标签: iphone cocoa-touch ios5 uipopovercontroller


【解决方案1】:

我找到了办法。实际上我无法给出 allowedArrowDirections 参数,因为方向不固定。所以我在参数中传递了一个“NO”并且它起作用了。感谢大家的帮助.. :)

【讨论】:

    【解决方案2】:

    只需检查您是否将 UITableView 添加为自定义视图的子视图..

    也可以试试这段代码...

        UIViewController *viewTemp = [[UIViewController alloc]init];
        viewTemp.view.frame = CGRectMake(0, 0, 300, 400);
        yourTable.frame =  CGRectMake(0, 0, 300, 400);
        [viewTemp.view addSubview:yourTable];///Add Table as a SubView of your custom view
    
        UIPopoverController *popTemp = [[UIPopoverController alloc]initWithContentViewController:viewTemp];
    
        [popTemp presentPopoverFromRect:CGRectMake(810.0, 35.0, 300, 210)  /// just set frame which from you want to show this popover view ... you can set like yourButton.frame;
                                inView:self.view
              permittedArrowDirections:UIPopoverArrowDirectionAny 
                              animated:YES];
        CGSize size = {300 , 400};// give your size which you want...
    
        popTemp=nil;
    

    【讨论】:

      猜你喜欢
      • 2013-01-06
      • 1970-01-01
      • 1970-01-01
      • 2021-06-24
      • 1970-01-01
      • 2020-10-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多