简体   繁体   English

仅适用于iPad的Settings.bundle?

[英]Settings.bundle for iPad only?

I have a situation where I need one setting to made available for my application via the settings app. 我有一种情况需要通过设置应用程序为我的应用程序提供一个设置。 My application is universal but this particular setting only makes sense on the iPad so I only want my application to show up in settings on the iPad. 我的应用程序是通用的,但这个特殊的设置只在iPad上有意义,所以我只希望我的应用程序显示在iPad上的设置中。 Is this possible? 这可能吗? I haven't found a way to do it and have tried the following: 我还没有找到办法,并尝试了以下方法:

1) Renaming the Settings.bundle to Settings~ipad.bundle. 1)将Settings.bundle重命名为Settings~ipad.bundle。 My app does not show up in Settings on either device. 我的应用程序未显示在任一设备的“设置”中。 I believe it must be named Settings.bundle. 我相信它必须命名为Settings.bundle。

2) Rename Root.plist to Root~ipad.plist. 2)将Root.plist重命名为Root~ipad.plist。 On the iPhone the Settings entry for my app still exists but there are no settings available. 在iPhone上,我的应用程序的设置条目仍然存在,但没有可用的设置。 I don't want the entry to be there. 我不希望这个条目存在。

3) I tried deleting the Settings.bundle if it exists and I am on the iPhone when my app launches the first time, but Settings.bundle is readonly. 3)我尝试删除Settings.bundle(如果它存在),当我的应用程序第一次启动时我在iPhone上,但Settings.bundle只读。

I know this is an old one, but I want to share my experiences on this. 我知道这是一个旧的,但我想分享我的经验。

I managed to create a setting for iPhone only in my app by creating another Root.plist file and naming that to Root~iphone.plist. 我设法通过创建另一个Root.plist文件并将其命名为Root~iphone.plist,在我的应用程序中为iPhone创建一个设置。 That way the iPad version of the app reads the Root.plist and iPhone version the Root~iphone.plist. 这样,应用程序的iPad版本读取Root.plist和iPhone版本的Root~iphone.plist。

Hope this helps anyone stumbling on this issue. 希望这有助于任何人在这个问题上绊脚石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM