Popup / Popup container changing size

3618
8
11-05-2012 08:39 AM
by Anonymous User
Not applicable
Original User: jgiesler

Hello Everyone,
I am having a problem with my popup view controller.  When in my popup view controller if I go to edit a features attributes, then rotate my device the popup with all the attributes then changes size and fill the entire screen.  I set up the Popup view controller using UImodalPresentationFormSheet.  I have attached images of what I am trying to do and what is happening.  I am not sure why this is happening, if anyone has any suggestions please feel free to send them.  Any help would be greatly appreciated.
Cheers,
Jeff
0 Kudos
8 Replies
NimeshJarecha
Esri Regular Contributor
Here is code, how to show popup view controller as form sheet in iPad.

    //present popup view controller
    //if ipad show formsheet
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
        self.popupsContainerVC.modalPresentationStyle = UIModalPresentationFormSheet;
 self.popupsContainerVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
 [self presentModalViewController:self.popupsContainerVC animated:YES];
    }
    else {
 self.popupsContainerVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
 [self presentModalViewController:self.popupsContainerVC animated:YES];
    }


Please let me know if you still see the same issue after using this code.

Regards,
Nimesh
0 Kudos
by Anonymous User
Not applicable
Original User: jgiesler

Nimesh,
Thanks for the quick reply I just tried the code you sent over.  I am still getting the same issue.   I have attached my current code, it looks pretty much the same as your except I am not checking if the device is an iPad as that is all we are developing to.  I am not sure what can be.  Any additional help would be great.
Thanks,
Jeff
if (PopupGraphics.count > 0)    {
        self.popupVC = [[ AGSPopupsContainerViewController alloc] initWithPopups:PopupGraphics usingNavigationControllerStack:NO];
        self.popupVC.delegate = self;
        self.popupVC.style = AGSPopupsContainerPagingStylePageControl;
        self.popupVC.styleColor = [UIColor blackColor];
        self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;
        [self presentModalViewController:self.popupVC animated:YES];
    }
0 Kudos
NimeshJarecha
Esri Regular Contributor
Do you see the same issue if you use iPad/iOS 5.1 simulator?

Regards,
Nimesh
0 Kudos
by Anonymous User
Not applicable
Original User: jgiesler

Yes.
Cheers,
Jeff
0 Kudos
NimeshJarecha
Esri Regular Contributor
Are you sure? I see this issue only with device/simulator running iOS 6, not iOS 5.1. Could you please double check?

Regards,
Nimesh
0 Kudos
by Anonymous User
Not applicable
Original User: jgiesler

Nimesh,
I missed understood your question(read as I didn't read careful enough), my current deployment target is 5.1 not the simulator. I checked and you are right.  The 5.1 simulator is not causing the same problem.
Thanks,
Jeff
0 Kudos
NimeshJarecha
Esri Regular Contributor
Thanks for confirming. It's iOS SDK/apple issue.

Since, your app is targeting iPad, you should show your popups in UIPopoverController rather than a modal view controller.

You should implement popupsContainer:wantsToShowViewController: ofType:fromViewController:atRect: and popupsContainer:wantsToHideViewController: ofType: methods of AGSPopupsContainerDelegate and show each view in UIPopoverController.

Regards,
Nimesh
0 Kudos
by Anonymous User
Not applicable
Original User: jgiesler

Nimesh,
Does one of the examples use this method?  I am a little unsure how to implement it or where to put it (still kind of new with ios).  I have attached my code for where i build the AGSPopupsViewController and launch the modalviewController.  Any suggestions would be great.
Cheers,
Jeff
-(void) mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint graphics:(NSDictionary *)graphics{
    PopupGraphics = [[NSMutableArray alloc] init];
    for (NSString* key in graphics) 
    {
        id value = [graphics objectForKey:key];
        for (AGSGraphic *featureGraphic in value)
        {
            AGSPopupInfo *popupinfo = [AGSPopupInfo popupInfoForGraphic:featureGraphic];
            NSArray *CellBustedValues = [featureGraphic.layer.name componentsSeparatedByString:@" - "];
            if (CellBustedValues.count >1)
            {
                popupinfo.title = [CellBustedValues objectAtIndex:1];
            }
            else 
            {
                popupinfo.title = featureGraphic.layer.name;
            }
            AGSPopup *popup = [AGSPopup popupWithGraphic:featureGraphic popupInfo:popupinfo];
            [PopupGraphics addObject:popup];
        }
    }
if (PopupGraphics.count > 0)
    {
self.popupVC = [[ AGSPopupsContainerViewControlleralloc] initWithPopups:PopupGraphicsusingNavigationControllerStack:NO];
        self.popupVC.delegate = self;
self.popupVC.style = AGSPopupsContainerPagingStylePageControl;
        self.popupVC.styleColor = [UIColor blackColor];
self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;
        [selfpresentModalViewController:self.popupVCanimated:YES];
    }
}


0 Kudos