Accéder au contenu principal

Boutons invisibles avec UIDocumentInteractionController

Les boutons OK et Export peuvent être invisibles dans un UIDocumentInteractionController.
Il s'agit en fait de la couleur "tint" qui n'est pas fixée dans UINavigationBar.
On fixe aussi le window.backgroundColor pour que la barre au dessus de l'application est bien un fond.

    if(@available(iOS 11.0, *)) {

        if(@available(iOS 13.0, *)) {

            self.window.backgroundColor =    

                                    UIColor.systemBackgroundColor;

            UINavigationBar.appearance.tintColor

                                    UIColor.linkColor;

        } else {

            self.window.backgroundColor =

                                    UIColor.whiteColor;

            UINavigationBar.appearance.tintColor

                                    UIColor.systemBlueColor;

        }

    }


Les ligne d'Objective-C ci-dessus règlent le problème et sont à mettre directement dans :

- (BOOL)application:(UIApplication *)application 

        didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;


Il faut imbriquer les @available car UIColor.linkColor et UIColor.systemBackgroundColor n'existe pas avant IOS13, mais il y a besoin d'utiliser ce patch dès IOS11.


Commentaires