开发者

placing conditions on what items will be shown from a settings bundle

Hey All. I'm wondering if it is possible to place conditions on what items will appear in the settings app for an application's settings bundle.

For example: I have several settings related to behavior of the camera in my app. But I do not want those items to appear in the settings app on devices that do 开发者_Go百科not have a camera.

I know how to check and do all of this in the app easy enough, but cannot seem to be able to find anything about this for the settings bundle. I saw at least one question about this from I think mid 2010 but it hasn't been answered.

Any help would be greatly appreciated.


My understanding is that the settings are determined at compilation time and cannot be modified at runtime.

Here's a similar question: Hiding preferences items in the settings bundle

Two options:

  1. Create in-app preference settings. However, I remember reading on the Apple Dev site that Apple recommends against this.

  2. Add a value to the camera related settings: "Unavailable". When the app is launched, determine if there is a camera, if not, programmatically set those settings to "Unavailable".

EDIT: I just came across this: OnlyDisplayOnInterfaceIdiom.

Indicates that the element is displayed only on specific types of devices. Set the value of this key to “Phone” to display the element on iPhone and iPod touch. Set the value to “Pad” to display it on iPad.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜