UIPageViewController: Unterschied zwischen den Versionen

Aus Byte-Welt Wiki
Keine Bearbeitungszusammenfassung
KKeine Bearbeitungszusammenfassung
 
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt)
Zeile 1: Zeile 1:
==Hinzufügen von Seiten==
==Hinzufügen von Seiten==
<code=objc>
<syntaxhighlight lang="objc">
UIViewController* newController = [UIViewController new];
UIViewController* newController = [UIViewController new];
[pageviewcontroller setViewControllers:[NSArray arrayWithObject:newController] direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
[pageviewcontroller setViewControllers:[NSArray arrayWithObject:newController] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
</code=objc>
</syntaxhighlight>
Es '''muss''' ''animated:NO'' gesetzt werden, sonst funktioniert es auf Grund eines Bugs nicht.


==Löschen von Seiten==
==Löschen von Seiten==
<code=objc>
<syntaxhighlight lang="objc">
[pageviewcontroller setViewControllers:[NSArray arrayWithObject:controllerToShow] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
[pageviewcontroller setViewControllers:[NSArray arrayWithObject:controllerToShow] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
</code=objc>
</syntaxhighlight>
Es '''muss''' ''animated:NO'' gesetzt werden, sonst funktioniert es auf Grund eines Bugs nicht.
Es '''muss''' ''animated:NO'' gesetzt werden, sonst funktioniert es auf Grund eines Bugs nicht.



Aktuelle Version vom 9. Januar 2021, 13:06 Uhr

Hinzufügen von Seiten

[Bearbeiten | Quelltext bearbeiten]
UIViewController* newController = [UIViewController new];
[pageviewcontroller setViewControllers:[NSArray arrayWithObject:newController] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

Es muss animated:NO gesetzt werden, sonst funktioniert es auf Grund eines Bugs nicht.

Löschen von Seiten

[Bearbeiten | Quelltext bearbeiten]
[pageviewcontroller setViewControllers:[NSArray arrayWithObject:controllerToShow] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

Es muss animated:NO gesetzt werden, sonst funktioniert es auf Grund eines Bugs nicht.