Displaying iOS Launch Images
-
I am trying to get my launch image to display on my app, with no success. I cannot find up-to-date information on the proper way to do this in Qt. Here is my .plist file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDisplayName</key> <string>TAP Display</string> <key>CFBundleExecutable</key> <string>tap_new_display_app</string> <key>CFBundleGetInfoString</key> <string>Created by Qt/QMake</string> <key>CFBundleIconFile</key> <string>nasa-logo.png</string> <key>CFBundleIdentifier</key> <string>com.nasa.tap-display</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.0</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NOTE</key> <string>This file was generated by Qt/QMake.</string> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>CFBundleIcons</key> <dict> <key>CFBundlePrimaryIcon</key> <dict> <key>CFBundleIconFiles</key> <array> <string>Icon-76</string> <string>Icon-76@2x</string> <string>Icon-Small-40</string> <string>Icon-Small-40@2x</string> <string>Icon-Small</string> <string>Icon-Small@2x</string> <string>iTunesArtwork</string> <string>iTunesArtwork@2x</string> </array> </dict> </dict> <key>UILaunchImages</key> <array> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>7.0</string> <key>UILaunchImageName</key> <string>Launch-768x1024-portrait</string> <key>UILaunchImageOrientation</key> <string>Portrait</string> <key>UILaunchImageSize</key> <string>{768, 1024}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>7.0</string> <key>UILaunchImageName</key> <string>Launch-1024x768-landscape</string> <key>UILaunchImageOrientation</key> <string>Landscape</string> <key>UILaunchImageSize</key> <string>{768, 1024}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>7.0</string> <key>UILaunchImageName</key> <string>Launch-1536x2048-portrait</string> <key>UILaunchImageOrientation</key> <string>Portrait</string> <key>UILaunchImageSize</key> <string>{1536, 2048}</string> </dict> <dict> <key>UILaunchImageMinimumOSVersion</key> <string>7.0</string> <key>UILaunchImageName</key> <string>Launch-2048x1536-landscape</string> <key>UILaunchImageOrientation</key> <string>Landscape</string> <key>UILaunchImageSize</key> <string>{1536, 2048}</string> </dict> </array> <key>UILaunchStoryboardName</key> <string>tap_display_launch_screen</string> </dict> </plist>
The icons are working just fine but no launch images. Here is my project file:
include(../top_srcdir.pri) # defines top-level source trees include(../ace_path.pri) CONFIG += c++11 link_prl SETTINGS_BUNDLE_DATA_ROOT.files += Root.plist SETTINGS_BUNDLE_DATA_ROOT.path = Settings.bundle SETTINGS_BUNDLE_DATA_LANG.files += Root.strings SETTINGS_BUNDLE_DATA_LANG.path = Settings.bundle/en.lproj QMAKE_BUNDLE_DATA += SETTINGS_BUNDLE_DATA_ROOT SETTINGS_BUNDLE_DATA_LANG ios { QMAKE_INFO_PLIST = tap_display.plist ios_icon.files += $$files($$PWD/ios/icons/*.png) launch_image.files += tap_display_launch_screen.xib $$files($$PWD/ios/launch-images/*.png) QMAKE_BUNDLE_DATA += ios_icon launch_image } QT += qml quick INCLUDEPATH += $$aop_util_includes \ $$aop_logger_includes \ $$tap_data_includes \ $$aop_serial_includes \ $$tap_messaging_includes \ $$aop_data_includes \ $$aop_measure_includes \ $$aop_interface_includes \ $$aop_xml_includes SOURCES += $$files(*.cpp) OBJECTIVE_SOURCES += $$files(*.mm) HEADERS += $$files(*.hpp) \ $$files(*.h) RESOURCES += qml.qrc macx { DEFINES += IOS_BUILD } # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Default rules for deployment. include(deployment.pri) #target link libraries include(../tap_data.pri) # defines tap_data library include(../tap_messaging.pri) # defines tap_messaging library include(../aop_interface.pri) include(../TableLookups.pri) include(../WindModel.pri)
The icon files, my .XIB file and my launch image files are all getting copied into the bundle, but again, while the icons work, the launch images do not. All I get is the default screen which displays the app name. I set the deployment target to iOS 7 or greater with no luck, as well as creating my own .XIB file (which I copied from the original). Still no luck.
Do I need to manually modify the .XIB to incorporate these launch files?
I would appreciate any help
-
@DRoscoe said:
tap_display_launch_screen.xib
You need to specify your xib in In your .plist:
<key>UILaunchStoryboardName</key> <string>tap_display_launch_screen</string>
-
@TioRoy It is there already. Its way at the bottom of the .plist file I posted. The question is, what changes do I need to make to the .xib file?
-
-
@TioRoy Ah yes! I got rid of the duplicate, but its still the same issue. I am guessing that the .xib is not properly formed, but I don't know how to add the launch images to the .xib
-
Ok, I figured out how to get the images in the XIB. I created a view for each image. It took me a while to figure out I could drag those objects from the lower right corner onto the launch screen view.
I can't seem to get the app to figure out which image and orientation to use, so I either added it incorrectly and the app cannot determine it, or I still need to tweak it a bit
-
@TioRoy OK, so I need to figure out how to do this in xCode and then capture the resulting .xib file and incorporate it into my .pro file?
-
Note that iOS has a bug where it caches old launch screens
https://stackoverflow.com/a/35783070