Opracowałem aplikację na iOS7, a teraz próbuję zaktualizować ją na iOS8. Problem jest następujący:IOS8, jak przenieść aktywny popover
Orientację ekranu aplikacji można obracać, a kilka przycisków w niektórych przypadkach porusza się drastycznie. Mam kilka popoverów wskazujących na te przyciski, więc jeśli popover jest otwarty po obróceniu ekranu, przycisk się porusza, potrzebuję również popover.
W iOS7 Robiłam to przez następujące: Kiedy ekran obracany zaktualizowałem ograniczeń
- (void) updateViewConstraints
{
if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
{
self.Button.constant = (CGFloat)10;
}
else
{
self.Button.constant = (CGFloat)5;
}
[super updateViewConstraints];
}
ja też przesunąć popover
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
if(TempDisplayPopoverController == examplePopoverController)
{
[examplePopoverController presentPopoverFromRect:[self ExamplePopoverPosition] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
początkowo załadować popover
- (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]
po prostu zwraca pozycję przycisku.
To wszystko działało bez zarzutu, byłem szczęśliwy, iPad był szczęśliwy i wszyscy się zachowywali.
Teraz z powodu iOS8 muszę zmienić kilka bitów.
self.interfaceOrientation
amortyzuje
[examplePopoverController presentPopoverFromRect:[self ExamplePopoverPosition] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
w didRotateFromInterfaceOrientation
zgłasza błąd
"Application tried to represent an active popover presentation: <UIPopoverPresentationController: 0x7bf59280>"
udało mi się naprawić self.interfaceOrientation
przez
- (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];
}
, ale nie mają pojęcia, jak rozwiązać problem z popover. Próbowałem już raz, ale nie mogę sprawić, żeby działało.
może ktoś rada
Dzięki
sam problem tutaj. Musimy zapytać Apple ... – giuseppe
cześć, nadal nie rozwiązałem tego <(przy czym nieco rozproszony z czymś innym) –
Wszelkie aktualizacje na ten temat? Mam ten sam problem, –