UIPopOverView问题中的TableView [英] TableView in UIPopOverView Issue

查看:88
本文介绍了UIPopOverView问题中的TableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UIPopover中遇到问题,我在UIPopover中添加了UITableView

I have a issue in UIPopover, I have added UITableView in UIPopover

当我在iOS7中运行其运行商品时。*如下所示:

When I am running its running good in iOS7.* as below:

但是当我在iOS8中运行时,它显示如下:

But while I am running in iOS8, it display as below:

我的代码如下

CustomPopOverViewController *viewControllerForPopover =
[self.storyboard instantiateViewControllerWithIdentifier:@"CustomPopOverVC"];

viewControllerForPopover.delegate = self;

int setTimeFlag = [[[selectedModuleProgram objectAtIndex:[sender tag]] valueForKey:kProgram_Mst_Program_Time_Flag] intValue];

if (setTimeFlag == 1)
{
    [viewControllerForPopover setListType:kListType_AddProgramOptions];
    viewControllerForPopover.preferredContentSize = CGSizeMake(333, 453);
}
else
{
    [viewControllerForPopover setListType:kListType_AddProgramOptionsWOA];
    viewControllerForPopover.preferredContentSize = CGSizeMake(333, 382);
}

self.popover = [[UIPopoverController alloc]
                initWithContentViewController:viewControllerForPopover];
self.popover.popoverBackgroundViewClass = [CustomPopoverBackgroundView class];
[self.popover presentPopoverFromRect:anchor.frame
                              inView:anchor.superview
            permittedArrowDirections:UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight animated:YES];

在我的代码 CustomPopOverViewController 是我的 UIViewController 并且我有一个tableview。

In my code CustomPopOverViewController is of my UIViewController and in that i have a tableview.

我已经设置了一个tableview框架如下:

I have set a frame of tableview as below:

tblViewList.frame = CGRectMake(tblViewList.frame.origin.x, tblViewList.frame.origin.y, tblViewList.frame.size.width, (72*[arrData count]));

不要全部选择。

推荐答案

我得到了解决方案,

我只是禁用 自动布局查看,我工作正常。

I just disable autolayout of view and i works fine.

我在搜索时知道, view.frame = cgrectmake(),在ios8中无法工作> autolayout 已启用..

I get to know while searching, view.frame = cgrectmake(), didnt work in ios8 if autolayout is enable..

谢谢。

这篇关于UIPopOverView问题中的TableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆