Question

Merry Christmas.

I have a view which contains a uitableview. Iam using wepopover to show aditional info when one of the tablecells are selected. However my issue is when selecting some cells, part of the popover is shown out of the view and is not visible. The content size is set correct and the point of origin is correct as well.

for adding the popover i do this where the frame is the frame of uitableview cell

detailedInfoView=[[ScheduleDetailedInformation alloc] initWithNibName:@"ScheduleDetailedInformation" bundle:nil];

        detailedInfoView.contentSizeForViewInPopover = detailedInfoView.view.frame.size;    

        navPopover = [[WEPopoverController alloc] initWithContentViewController:detailedInfoView];

        [navPopover presentPopoverFromRect:frame
                                    inView:self.tableview
                  permittedArrowDirections:UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown|UIPopoverArrowDirectionLeft|UIPopoverArrowDirectionAny
                                  animated:YES];

Can anyone might tell me what i have forgotten or maybe a workaround?

Thanx

Was it helpful?

Solution

Unfortunately no one has provided me with a golden answer. However I have solved the issue myself. Before when adding the popover view I was adding it to the uitableview, however this created the issue in the first place. Instead I added it to the parent view, however this gave some positioning error which I solved with the following line of code - which converts the position of the uitableviewcell to the position in the parent view.

CGPoint tmp= [[tableView cellForRowAtIndexPath:indexPath].superview convertPoint:[tableView cellForRowAtIndexPath:indexPath].frame.origin toView:nil];

CGRect frame = CGRectMake(tmp.x, tmp.y-(CGRectCell.size.height/2), CGRectCell.size.width, CGRectCell.size.height);

Hope this can help someone else :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top