Я разработал приложение для iOS7 и теперь пытаюсь обновить его для iOS8. Проблема i имеет следующее:IOS8 как перемещать активный popover
Ориентация экрана приложения может быть повернута, и в некоторых случаях несколько кнопок резко перемещаются. У меня есть несколько popovers, которые указывают на эти кнопки, поэтому, если всплывающее окно открыто, когда экран вращается, кнопка перемещается, мне также нужен popover.
В iOS7 я сделал это следующее: Когда экран повернутым я обновленных ограничениями
- (void) updateViewConstraints
{
if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
{
self.Button.constant = (CGFloat)10;
}
else
{
self.Button.constant = (CGFloat)5;
}
[super updateViewConstraints];
}
Я также переместить поповер
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
if(TempDisplayPopoverController == examplePopoverController)
{
[examplePopoverController presentPopoverFromRect:[self ExamplePopoverPosition] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
Я сначала загрузить поповер
- (void) LoadPopover{
examplePopover = [[examplep alloc] initWithNibName:@"exampleP" bundle:nil];
[examplePopover setDelegate:self];
examplePopoverController = [[UIPopoverController alloc] initWithContentViewController: examplePopover];
[examplePopoverController setDelegate:self];
examplePopoverController.popoverContentSize = examplePopover.view.frame.size;
TempDisplayPopoverController = examplePopoverController;
if ([examplePopoverController isPopoverVisible])
{
[examplePopoverController dismissPopoverAnimated:YES];
}
else
{
[examplePopoverController presentPopoverFromRect:[self ExamplePopoverPosition] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
[self ExamplePopoverPosition]
просто возврат кнопка положение.
Все это прекрасно работало, я был счастлив, iPad был счастлив и все вел себя.
Теперь из-за iOS8 мне нужно изменить несколько бит.
self.interfaceOrientation
амортизируется
[examplePopoverController presentPopoverFromRect:[self ExamplePopoverPosition] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
в didRotateFromInterfaceOrientation
выдает ошибку
"Application tried to represent an active popover presentation: <UIPopoverPresentationController: 0x7bf59280>"
Я сумел исправить self.interfaceOrientation
по
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self SetUpScreen:toInterfaceOrientation];
}
- (void) SetUpScreen:(UIInterfaceOrientation)toInterfaceOrientation{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
self.Button.constant = (CGFloat)10;
}
else
{
self.Button.constant = (CGFloat)5;
}
[super updateViewConstraints];
}
, но не знаю, как решить проблему с popover. Я пробовал
popoverController: willRepositionPopoverToRect: inView:
но просто не может показаться, что он работает.
Может кто-нибудь совет
Благодаря
же проблема здесь. Мы должны спросить Apple ... – giuseppe
привет там, я до сих пор не решил этого <(предоставлено было немного отвлечено чем-то еще) –
Любое обновление по этому вопросу? У меня такая же проблема –