简体   繁体   English

如何在 ios 应用程序的 settings.bundle 中创建检查选项

[英]How to create Check option in settings.bundle in ios app

Hi I would like to implement check option like html radio button behavior where only one option is selectable at a time.嗨,我想实现像 html 单选按钮行为这样的检查选项,其中一次只能选择一个选项。 I would like to implement this in ios app settings (Settings.bundle).我想在 ios 应用程序设置(Settings.bundle)中实现这一点。 I couldn't find a single example anywhere but I do see other apps have this implemented.我在任何地方都找不到一个例子,但我确实看到其他应用程序已经实现了这个。 Please see screenshot below.请看下面的截图。

在此处输入图像描述

Ok PSMultiValueSpecifier was the word that helped me.好的 PSMultiValueSpecifier 是帮助我的词。 Thank you Rudedog.谢谢鲁德多。

To further add so it can help others.进一步添加,以便它可以帮助其他人。 You can use below plist code to achieve.您可以使用下面的 plist 代码来实现。 I got it from https://github.com/allanalves/Environment-Manager-iOS/blob/master/Settings.bundle/Root.plist我从https://github.com/allanalves/Environment-Manager-iOS/blob/master/Settings.bundle/Root.plist得到它

<dict>
            <key>Type</key>
            <string>PSGroupSpecifier</string>
            <key>Title</key>
            <string>Server</string>
            <key>FooterText</key>
            <string>Don&apos;t forget to choose the &quot;Custom URL&quot; option if you want to specify an URL above.</string>
        </dict>
        <dict>
            <key>Type</key>
            <string>PSMultiValueSpecifier</string>
            <key>Title</key>
            <string>Environment</string>
            <key>Key</key>
            <string>environment</string>
            <key>DefaultValue</key>
            <string>production</string>
            <key>Values</key>
            <array>
                <string>production</string>
                <string>homologation</string>
                <string>development</string>
                <string>custom</string>
            </array>
            <key>Titles</key>
            <array>
                <string>Production</string>
                <string>Homologation</string>
                <string>Development</string>
                <string>Custom URL</string>
            </array>
        </dict>

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

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