Reimplement methods in UIViewController
-
Hi,
I need to reimplement prefersHomeIndicatorAutoHidden getter function to return true in landscape mode because I want my application to use bigger part of the screen on iPhone X and later:
https://developer.apple.com/documentation/uikit/uiviewcontroller/2887510-prefershomeindicatorautohiddenSo the question is how to reimplement UIViewController in a Qt Quick app. It appears that that all Qt apps are using QIOSViewController class whose source code is in /Library/Qt/5.12.10/Src/qtbase/src/plugins/platforms/ios/QIOSViewController.h (and .mm)
The class is part of the Qt binaries and included in application bundle in binary form. That would mean I have to modify Qt code and use my recompiled Qt binaries. I don't want to do that.Is there a way to make my app use other view controller? Or other way to set the iOS autohide Home indicator feature without recompiling Qt?
-
@ondrejandrej
take a look at my old project here:
https://github.com/DeiVadder/iPhoneXworkaroundsI think that is what you're looking for
-
I don't think so. Your project contains the QIOSViewController class which isn't instantiated anywhere. So its code is never executed.
-
@ondrejandrej said in Reimplement methods in UIViewController:
I don't think so
you just assume.
I just cloned it and rerun it, 3 years later and it still works just as intended.
the home bar fades out after a couple of seconds, just as intended
-
You are right. A qDebug() printout in prefersHomeIndicatorAutoHidden shows that the code is really executed. But I realized that it only does what its name suggests. So the Home indicator disappears, but application window doesn't get any bigger.
I finally solved it by setting window flags like this:
ApplicationWindow { flags: Qt.MaximizeUsingFullscreenGeometryHint ... }
-
@ondrejandrej up like mentioned in the readme of the repository :D
keep in mind though, that you don't really get the real estate of that area for touch use, but only for visualisation.
As soon as you touch there, the home bar will reappear.
If you want that, for example to use in a game, than Xcode now have these settings here
which I believe, don't nail me on it asI haven't tried it yet :D, would take care of that for you. I think those infos are stored in the info.plist file, but I'm unsure about the exact key.