TableView in UIPopOverView Issue

拜拜、爱过 提交于 2019-12-06 04:32:35

问题


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

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

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

My code is 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];

In my code CustomPopOverViewController is of my UIViewController and in that i have a 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]));

Don't get all option.


回答1:


I got the solution,

I just disable autolayout of view and i works fine.

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

Thank you.



来源:https://stackoverflow.com/questions/26815797/tableview-in-uipopoverview-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!