设置包中的只读字符串 [英] Read-Only string in settings bundle

查看:68
本文介绍了设置包中的只读字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个Settings.bundle,但是在显示版本号时,我希望这些字段是只读的。

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 type from text to title, but when I do this, the settings entry isn't displayed.

推荐答案

        <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>

我可以在root.plist中添加上述字典的只读变量'Version'。你有没有使用Title说明符?
或尝试添加上面的字典。在你的root.plist中,这将在你的设置中以组样式添加只读标题。

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.

这篇关于设置包中的只读字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆