最近,我一直在使用出色的框架(令人敬畏的Dustin Howett撰写的Theos)开发Cydia的调整项,并且我想知道是否有任何方法可以使调整项的偏好组合中的单元格变灰。不需要是否需要专用API,因为这是针对越狱环境的。任何帮助,链接或参考,不胜感激。我正在使用 private 框架(Preferences.framework)

最佳答案

我没有随身携带的越狱电话,因此无法测试,但是如果您看起来at the Preferences docs on iphonedevwiki,您会看到有一个标记将使偏好项变灰(enabled)。因此,您可以在首选项plist文件中使用如下代码:

     <dict>
        <key>cell</key>
        <string>PSSwitchCell</string>
        <key>default</key>
        <true/>
        <key>defaults</key>
        <string>com.mycompany.myapp</string>
        <key>key</key>
        <string>wifi_location</string>
        <key>label</key>
        <string>WiFi Location</string>
        <key>enabled</key>
        <false/>                           <!-- gray out this item -->
     </dict>

如果查看the preference loader docs,您还可以将代码注入Preferences.app中,这可能允许您动态设置此标志(如果要调整不是您自己的应用程序,则可能需要此标志)。

See more on this here

稍后,我将尝试进行测试,并希望更新此答案。

关于iphone - 如何使ios设置捆绑包(PreferenceLoader)中的特定单元变灰?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14397120/

10-09 13:01