I have a written a simple example where I have a Utility Application project with one UIScrollView
on it. When I click the info button to flip the screen and return the UIScrollView
now is unresponsive. Not only that but I purposely placed the scroller in the Interface Builder in the upper left corner and then programmatically set it in the center. when I come back from the flipside its shifted up to the top left corner and unresponsive. why?
This is my .h
file:
#import "POCFlipsideViewController.h"
@interface POCMainViewController : UIViewController <POCFlipsideViewControllerDelegate, UIScrollViewDelegate>
@property (nonatomic,retain) IBOutlet UIScrollView *scroller;
@end
This is my .m file
#import "POCMainViewController.h"
@interface POCMainViewController ()
@end
@implementation POCMainViewController
@synthesize scroller =_scroller;
- (void)viewDidAppear:(BOOL)animated
{
[_scroller setContentSize:CGSizeMake(80.0f, 320.0f)];
[_scroller setFrame:CGRectMake(120, 131, 80, 214)];
[super viewDidAppear:animated];
}
- (void)viewDidLoad
{
_scroller.delegate = self;
_scroller.showsVerticalScrollIndicator = NO;
_scroller.decelerationRate = UIScrollViewDecelerationRateFast;
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Flipside View
- (void)flipsideViewControllerDidFinish:(POCFlipsideViewController *)controller
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showAlternate"]) {
[[segue destinationViewController] setDelegate:self];
}
}
@end
The rest is boiler plate straight from Xcode.