【问题标题】:Hidding field in root.plist fileroot.plist 文件中的隐藏字段
【发布时间】:2013-03-17 08:34:15
【问题描述】:

根据这篇文章,我使用 root.plist 文件来设置我的 monotouch iPhone 应用程序:

http://adtmag.com/articles/2010/04/13/working-with-application-settings-in-monotouch.aspx

我们如何才能拥有一个默认不可见的字段,而应用程序可以根据条件更改可见性?

【问题讨论】:

标签: iphone xamarin.ios settings.bundle


【解决方案1】:

默认情况下隐藏设置。

如果你这样做:

var defaults = NSUserDefaults.StandardDefaults;
defaults.SetInt(21, "TestInt");
defaults.Synchronize();

Assert.That(defaults.IntForKey("TestInt"), Is.EqualTo(21));

如果您不在 plist 文件中设置任何内容,它将完全隐藏。 (注意:我在这里使用 NUnit)

因此,如果您想隐藏某些内容,请不要将值添加到您的 Settings.bundle 或 Root.plist。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-06
    • 2012-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多