0

When I present my modal view using the UIModalPresentationFormSheet style it centers correctly, but when the keyboard appears (a second after), instead of moving the modal view up vertically it moves it either to the left or to the right, almost as if it thought it were in portrait mode. If I rotate my device, it fixes itself to the correct orientation.

The app is set to landscape only but I can't figure out the issue.

What's wrong here?

enter image description here

enter image description here

I am displaying my view using the following method:

- (void)presentEventEditViewControllerWithEventStore:(EKEventStore*)eventStore {

EKEventEditViewController *evc = [[EKEventEditViewController alloc] init];
evc.eventStore = eventStore;
EKEvent* event = [EKEvent eventWithEventStore:eventStore];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"MM.dd.yyyy"];
NSString *startDate = @"11.01.2014";
NSString *endDate = @"11.07.2014";

//Pre-populated Info
event.startDate = [dateFormatter dateFromString:startDate];
event.endDate = [dateFormatter dateFromString:endDate];
event.allDay = YES;
event.location = @"The Big Island, Hawaii";
event.availability = EKEventAvailabilityBusy;
evc.event = event;
evc.editViewDelegate = self;
evc.delegate = self;

evc.modalPresentationStyle = UIModalPresentationFormSheet;
evc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

[self presentViewController:evc animated:YES completion:nil];

}

KingPolygon
  • 4,753
  • 7
  • 43
  • 72
  • Hi Tony. No I'm not, I actually want the keyboard, except that when it becomes the first responder instead of pushing my view up, it pushes it to the left or right. – KingPolygon May 07 '14 at 06:42
  • what are you using to “push" the view when it became the first responder? – TonyMkenu May 07 '14 at 06:46
  • Just updated my answer to show my method. – KingPolygon May 07 '14 at 06:49
  • you have right... there is a issues with EKEventEditViewController... perhaps.. because has the own navController!!! – TonyMkenu May 07 '14 at 07:45
  • this behavior is only on evc.modalPresentationStyle = UIModalPresentationFormSheet; but it is ok for modalPresentationStyle = UIModalPresentationPageSheet !!! – TonyMkenu May 07 '14 at 07:52
  • Yeah but I want to display it using the formsheet style because it looks much better + it matches my other modal views. – KingPolygon May 07 '14 at 10:43

1 Answers1

0

I have the exact same problem in iOS 7. I solved it by doing :

[self presentViewController:evc animated:YES completion:^{
    evc.view.superview.center = self.view.center;
}];
Jon - LBAB
  • 928
  • 11
  • 20