Dismiss modal view changes underlying UIScrollView
There must be something basic that I am missing here. I have a UIScrollView open, which is controlled by a customer UIScrollViewController (called DataController). At a certain point in time, input from the user is needed, so I open a modal UIViewController from the DataController:
ElementSelectController *viewController = [[ElementSelectController alloc] initWithNibName:@"ElementSelectController" bundle:nil]; viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; viewController.theDelegate = self; [self presentModalViewController:viewController animated:YES];
Once the user is ready with the modal view, it is dismissed again. This also happens from the DataController:
This all works fine.
But when the modal view is gone, it turns out that the underlying UIScrollView is resized to full screen, and scrolled to position (0,0). This is the case even with a simple modal view that does not do anything else but be dismissed.
Obviously, I want the UIScrollView to remain in the same state and size as it was before the modal view came up.
Any ideas what I am doing wrong?
I checked the stack trace when the UIScrollView frame is set (through a break-point in setFrame: of a custom UIScrollView), and it appears that it is called from:
which is called via, via from the dismissModalViewControllerAnimated call.
- Is there a way to access the haptic feedback via WatchKit?
- Cocoapods error: “Pull is not possible because you have unmerged files.”
- Why I'm getting gesture recognizers cannot be used on prototype objects?
- PhoneGap: Scaling down a webpage with viewport
- Will iOS region monitoring call didEnterRegion on my app if my app is in a terminated state?
- iOS 8 - How to determine the foreground app as well as get list of running apps
Solutions Collect From Internet About “Dismiss modal view changes underlying UIScrollView”
Is perfectly normal for transitioning from the modal back to your view. This is the animation etc, try you modal with animation if you think that could make a difference.
Take a look at your
Unload if appropriate, although unlikely those are called for your trivial test with nothing in the modal.
Try placing some logging in those methods to see which is called.
Also are you saying there is no custom code in those methods, or your controller doesn’t override them at all? Could make a difference.
- Segmentation fault: 11 when attempting to codesign .app
- How to detect touches in status bar
- SKAction.colorizeWithColor makes SKLabelNode disappear
- main Differenece Between View-Based and Window-Based Application template?
- NSPredicate not executed
- iPhone: Detecting user inactivity/idle time since last screen touch
- Uploading files over HTTP fails on iOS 8.0.0 GM Safari
- “Failed to upload *.app on Device ” Error in iPhone
- on top tabbar controller or segmented
- Copy target file to another location in a post build step in CMake
- How to open maps App programmatically with coordinates in swift?
- How to decrement a Character that contains a digit?
- on apple osx lion, make not in path
- How to parse specific googlemaps API webservices JSON repsonse
- Swift make method parameter mutable?