UIKit Keys
转自:http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
The UIKit framework provides the infrastructure you need for creating iOS applications. You use the keys associated with this framework to configure the appearance of your application at launch time and the behavior of your application once it is running.
UIKit keys use the prefix UI
to distinguish them from other keys. For more information about using UIKit to create and configure iOS applications, see iOS Application Programming Guide.
Key Summary
Table 1 contains an alphabetical listing of UIKit keys, the corresponding name for that key in the Xcode property list editor, a high-level description of each key, and the platforms on which you use it. Detailed information about each key is available in later sections.
Key | Xcode name | Summary | Availability |
---|---|---|---|
"Fonts provided by application” | Specifies a list of application-specific fonts. See “UIAppFonts” for details. | iOS 3.2 and later | |
"Application does not run in background” | Specifies whether the application terminates instead of run in the background. See “UIApplicationExitsOnSuspend” for details. | iOS 4.0 and later | |
"Required background modes” | Specifies that the application needs to continue running in the background. See “UIBackgroundModes” for details. | iOS 4.0 and later | |
"Targeted device family” | Inserted automatically by Xcode to define the target device of the application. See “UIDeviceFamily” for details. | iOS 3.2 and later | |
"Application supports iTunes file sharing” | Specifies whether the application shares files with the user’s computer through iTunes. See “UIFileSharingEnabled” for details. | iOS 3.2 and later | |
“Initial interface orientation” | Specifies the initial orientation of the application’s user interface. See “UIInterfaceOrientation” for details. | iOS | |
"Launch image” | Specifies the name of the application’s launch image. See “UILaunchImageFile” for details. | iOS 3.2 and later | |
"Icon already includes gloss effects” | Specifies whether the application’s icon already includes a shine effect. See “UIPrerenderedIcon” for details. | iOS | |
"Required device capabilities” | Specifies the device-related features required for the application to run. See “UIRequiredDeviceCapabilities” for details. | iOS 3.0 and later | |
"Application uses Wi-Fi” | Specifies whether this application requires a Wi-Fi connection. See “UIRequiresPersistentWiFi” for details. | iOS | |
"Status bar is initially hidden” | Specifies whether the status bar is initially hidden when the application launches. See “UIStatusBarHidden” for details. | iOS | |
"Status bar style” | Specifies the style of the status bar as the application launches. See “UIStatusBarStyle” for details. | iOS | |
"Supported external accessory protocols” | Specifies the communications protocols supported for communication with attached hardware accessories. See“UISupportedExternalAccessoryProtocols” for details. | iOS 3.0 and later | |
"Supported interface orientations” | Specifies the orientations that the application supports. See “UISupportedInterfaceOrientations” for details. | iOS 3.2 and later | |
"Renders with edge antialiasing” | Specifies whether Core Animation layers use antialiasing when drawing does not align to pixel boundaries. See “UIViewEdgeAntialiasing” for details. | iOS 3.0 and later | |
"Renders with group opacity” | Specifies whether Core Animation layers inherit the opacity of their superlayer. See “UIViewGroupOpacity” for details. | iOS 3.0 and later |
UIAppFonts
UIAppFonts
(Array
- iOS) specifies any application-provided fonts that should be made available through the normal mechanisms. Each item in the array is a string containing the name of a font file (including filename extension) that is located in the application’s bundle. The system loads the specified fonts and makes them available for use by the application when that application is run.
This key is supported in iOS 3.2 and later.
UIApplicationExitsOnSuspend
UIApplicationExitsOnSuspend
(Boolean
- iOS) specifies that the application should be terminated rather than moved to the background when it is quit. Applications linked against iOS SDK 4.0 or later can include this key and set its value to YES
to prevent being automatically opted-in to background execution and application suspension. When the value of this key is YES
, the application is terminated and purged from memory instead of moved to the background. If this key is not present, or is set toNO
, the application moves to the background as usual.
This key is supported in iOS 4.0 and later.
UIBackgroundModes
UIBackgroundModes
(Array
- iOS) specifies that the application provides specific background services and must be allowed to continue running while in the background. These keys should be used sparingly and only by applications providing the indicated services. Where alternatives for running in the background exist, those alternatives should be used instead. For example, applications can use the signifiant location change interface to receive location events instead of registering as a background location application.
Table 2 lists the possible string values that you can put into the array associated with this key. You can include any or all of these strings but your application must provide the indicated services.
Value | Description |
---|---|
| The application plays audible content in the background. |
| The application provides location-based information to the user and requires the use of the standard location services (as opposed to the significant change location service) to implement this feature. |
| The application provides Voice-over-IP services. Applications with this key are automatically launched after system boot so that the application can reestablish VoIP services. |
This key is supported in iOS 4.0 and later.
UIDeviceFamily
UIDeviceFamily
(Number
or Array
- iOS) specifies the underlying hardware type on which this application is designed to run.
The value of this key is usually an integer but it can also be an array of integers. Table 3 lists the possible integer values you can use and the corresponding devices.
Value | Description |
---|---|
1 | (Default) The application runs on iPhone and iPod touch devices. |
2 | The application runs on iPad devices. |
This key is supported in iOS 3.2 and later.
UIFileSharingEnabled
UIFileSharingEnabled
(Boolean
- iOS) specifies whether the application shares files through iTunes. If this key is YES
, the application shares files. If it is not present or is NO
, the application does not share files. Applications must put any files they want to share with the user in their <Application_Home>/Documents
directory, where <Application_Home> is the path to the application’s home directory.
In iTunes, the user can access an application’s shared files from the File Sharing section of the Apps tab for the selected device. From this tab, users can add and remove files from the directory.
This key is supported in iOS 3.2 and later.
UIInterfaceOrientation
UIInterfaceOrientation
(String
- iOS) specifies the initial orientation of the application’s user interface.
This value is based on the UIInterfaceOrientation
constants declared in the UIApplication.h
header file. The default style is UIInterfaceOrientationPortrait
.
UILaunchImageFile
UILaunchImageFile
(String
- iOS) specifies the name of the launch image file for the application. If this key is not specified, the system assumes a name of Default.png
. This key is typically used by universal applications when different sets of launch images are needed for iPad versus iPhone or iPod touch devices.
If you include this key in your Info.plist
file, any launch images you include in your application’s bundle should be based on the string. For example, suppose you want to include portrait and landscape launch images for iPad using the base nameMyiPadImage.png
. You would include the UILaunchImageFile~ipad
key in your Info.plist
file and set its value to MyiPadImage.png
. You would then include a MyiPadImage-Portrait.png
file and a MyiPadImage-Landscape.png
file in your bundle to specify the corresponding launch images.
This key is supported in iOS 3.2 and later.
UIPrerenderedIcon
UIPrerenderedIcon
(Boolean
- iOS) specifies whether the application’s icon already contains a shine effect. If the icon already has this effect, you should set this key to YES
to prevent the system from adding the same effect again. All icons automatically receive a rounded bezel regardless of the value of this key.
Value | Description |
---|---|
| iOS does not apply a shine effect to the application icon. |
| (Default) iOS applies a shine effect to the application icon. |
UIRequiredDeviceCapabilities
UIRequiredDeviceCapabilities
(Array
or Dictionary
- iOS) lets iTunes and the App Store know which device-related features an application requires in order to run. iTunes and the mobile App Store use this list to prevent customers from installing applications on a device that does not support the listed capabilities.
If you use an array, the presence of a given key indicates the corresponding feature is required. If you use a dictionary, you must specify a Boolean value for each key. If the value of this key is true, the feature is required. If the value of the key is false, the feature must not be present on the device. In both cases, omitting a key indicates that the feature is not required but that the application is able to run if the feature is present.
Table 4 lists the keys that you can include in the array or dictionary associated with the UIRequiredDeviceCapabilities
key. You should include keys only for the features that your application absolutely requires. If your application can accommodate missing features by avoiding the code paths that use those features, do not include the corresponding key.
Key | Description |
---|---|
Include this key if your application requires (or specifically prohibits) the presence of the Phone application. You might require this feature if your application opens URLs with the | |
Include this key if your application requires (or specifically prohibits) access to the networking features of the device. | |
Include this key if your application requires (or specifically prohibits) the presence of the Messages application. You might require this feature if your application opens URLs with the | |
Include this key if your application requires (or specifically prohibits) the presence of a camera on the device. Applications use the | |
Include this key if your application requires (or specifically prohibits) auto-focus capabilities in the device’s still camera. Although most developers should not need to include this key, you might include it if your application supports macro photography or requires sharper images in order to do some sort of image processing. | |
Include this key if your application requires (or specifically prohibits) the presence of a forward-facing camera. Applications use the | |
Include this key if your application requires (or specifically prohibits) the presence of a camera flash for taking pictures or shooting video. Applications use the | |
Include this key if your application requires (or specifically prohibits) the presence of a camera with video capabilities on the device. Applications use the | |
Include this key if your application requires (or specifically prohibits) the presence of accelerometers on the device. Applications use the classes of the Core Motion framework to receive accelerometer events. You do not need to include this key if your application detects only device orientation changes. | |
Include this key if your application requires (or specifically prohibits) the presence of a gyroscope on the device. Applications use the Core Motion framework to retrieve information from gyroscope hardware. | |
Include this key if your application requires (or specifically prohibits) the ability to retrieve the device’s current location using the Core Location framework. (This key refers to the general location services feature. If you specifically need GPS-level accuracy, you should also include the | |
Include this key if your application requires (or specifically prohibits) the presence of GPS (or AGPS) hardware for greater accuracy when tracking locations. If you include this key, you should also include the | |
Include this key if your application requires (or specifically prohibits) the presence of magnetometer hardware. Applications use this hardware to receive heading-related events through the Core Location framework. | |
Include this key if your application requires (or specifically prohibits) Game Center (iOS 4.1 and later.) | |
Include this key if your application uses the built-in microphone or supports accessories that provide a microphone. | |
Include this key if your application requires (or specifically prohibits) the presence of the OpenGL ES 1.1 interfaces. | |
Include this key if your application requires (or specifically prohibits) the presence of the OpenGL ES 2.0 interfaces. | |
Include this key if your application is compiled only for the armv6 instruction set. (iOS v3.1 and later.) | |
Include this key if your application is compiled only for the armv7 instruction set. (iOS v3.1 and later.) | |
Include this key if your application requires (or specifically prohibits) peer-to-peer connectivity over Bluetooth. (iOS v3.1 and later.) |
This key is supported in iOS 3.0 and later.
UIRequiresPersistentWiFi
UIRequiresPersistentWiFi
(Boolean
- iOS) specifies whether the application requires a Wi-Fi connection. iOS maintains the active Wi-Fi connection open while the application is running.
Value | Description |
---|---|
| iOS opens a Wi-Fi connection when this application is launched and keeps it open while the application is running. Use with Wi-Fi–based applications. |
| (Default) iOS closes the active Wi-Fi connection after 30 minutes. |
UIStatusBarHidden
UIStatusBarHidden
(Boolean
- iOS) specifies whether the status bar is initially hidden when the application launches.
Value | Description |
---|---|
| Hides the status bar. |
| Shows the status bar. |
UIStatusBarStyle
UIStatusBarStyle
(String
- iOS) specifies the style of the status bar as the application launches.
This value is based on the UIStatusBarStyle
constants declared in UIApplication.h
header file. The default style is UIStatusBarStyleDefault
.
UISupportedExternalAccessoryProtocols
UISupportedExternalAccessoryProtocols
(Array
- iOS) specifies the protocols that your application supports and can use to communicate with external accessory hardware. Each item in the array is a string listing the name of a supported communications protocol. Your application can include any number of protocols in this list and the protocols can be in any order. The system does not use this list to determine which protocol your application should choose; it uses it only to determine if your application is capable of communicating with the accessory. It is up to your code to choose an appropriate communications protocol when it begins talking to the accessory.
This key is supported in iOS 3.0 and later. For more information about communicating with external accessories, see “Communicating with External Accessories” in iOS Application Programming Guide.
UISupportedInterfaceOrientations
UISupportedInterfaceOrientations
(Array
- iOS) specifies the interface orientations your application supports. The system uses this information (along with the current device orientation) to choose the initial orientation in which to launch your application. The value for this key is an array of strings. Table 5 lists the possible string values you can include in the array.
Value | Description |
---|---|
| The device is in portrait mode, with the device held upright and the home button at the bottom. If you do not specify any orientations, this orientation is assumed by default. |
| The device is in portrait mode but upside down, with the device held upright and the home button at the top. |
| The device is in landscape mode, with the device held upright and the home button on the left side. |
| The device is in landscape mode, with the device held upright and the home button on the right side. |
This key is supported in iOS 3.2 and later.
UIViewEdgeAntialiasing
UIViewEdgeAntialiasing
(Boolean
- iOS) specifies whether Core Animation layers use antialiasing when drawing a layer that is not aligned to pixel boundaries.
Value | Description |
---|---|
| Use antialiasing when drawing a layer that is not aligned to pixel boundaries. This option allows for more sophisticated rendering in the simulator but can have a noticeable impact on performance. |
| (Default) Do not use antialiasing. |
This key is supported in iOS 3.0 and later.
UIViewGroupOpacity
UIViewGroupOpacity
(Boolean
- iOS) specifies whether Core Animation sublayers inherit the opacity of their superlayer.
Value | Description |
---|---|
| Inherit the opacity of the superlayer. This option allows for more sophisticated rendering in the simulator but can have a noticeable impact on performance. |
| (Default) Do not inherit the opacity of the superlayer. |
This key is supported in iOS 3.0 and later.