Search code examples
objective-cuitableviewios8uipopovercontroller

TableView in UIPopOverView Issue


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

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

Image 1

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

enter image description here

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.


Solution

  • 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.