Read-Only string in settings bundle

后端 未结 3 1737
孤街浪徒
孤街浪徒 2021-01-05 00:48

I\'ve added a Settings.bundle, however while displaying version numbers I\'d like the fields to be read-only.

I\'ve seen a few suggestions that say to change the typ

相关标签:
3条回答
  • 2021-01-05 01:20

    To display Title property in the Settings.bundle you need also to add "Default Value" (it could be empty).

    Check the answer here: https://stackoverflow.com/a/22712746/1757229

    0 讨论(0)
  • 2021-01-05 01:30

    you need to change your type from PSTextFieldSpecifier to PSTitleValueSpecifier.

    0 讨论(0)
  • 2021-01-05 01:44
            <array>    
                <dict>
                    <key>Type</key>
                    <string>PSGroupSpecifier</string>
                    <key>Title</key>
                    <string>version</string>
                </dict>
                <dict>
                    <key>DefaultValue</key>
                    <string>1.1</string>
                    <key>Key</key>
                    <string>version</string>
                    <key>Title</key>
                    <string>version</string>
                    <key>Type</key>
                    <string>PSTitleValueSpecifier</string>
                </dict>
            </array>
    

    I am able to add readonly variable 'Version' with the above dictionary in root.plist. Have you set using Title specifier ?? Or Try adding above dict. in your root.plist , this will add readonly title in your settings in group style.

    0 讨论(0)
提交回复
热议问题