在应用程序中显示iphone应用程序设置 [英] Display iphone application settings within your application

查看:211
本文介绍了在应用程序中显示iphone应用程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iPhone支持定义应用程序设置的方法,以便在设置应用程序中自动创建UI。我还希望允许用户编辑应用程序中的应用程序设置,但重用自动创建的同一个UI是很好的。



查看:应用程序设置



有一种方法让应用程序使用与Settings应用程序相同的UI显示设置。

解决方案

没有方法可以重用UI。



但是,有一种方法可以重用数据。 Settings.app将把设置放在NSUserDefaults下的Settings.bundle plist文件中指定的键下。您可以更改应用中的这些值,然后切换到Settings.app,并看到它将更改以反映您的新值。如果你想允许用户编辑应用中的设置(如果他们习惯的话)或者在Settings.app中(如果他们习惯了),这是非常好的。



编辑#1



您可能要查看此主题。有一个名为 mySettings



有现在有几个图书馆可以执行此操作:




The iphone supports a means of defining your application's settings such that it will automatically create a UI in the Settings app. I want to also allow the user to edit the application settings within the application but it'd be nice to reuse the same UI that is automatically created.

See: Application Settings

Is there a way to have your application display the settings using the same UI that the Settings application does?

解决方案

No there is not a way to reuse the UI.

There is, however, a way to reuse the data. Settings.app will put the settings in NSUserDefaults under the keys specified in your Settings.bundle plist file. You can alter those values in your app, then switch to Settings.app and see that it will have changed to reflect your new values. This is really nice if you want to allow the user to edit settings in the app (if that's what they're used to) or in Settings.app (if that's what they're used to).

EDIT #1

You may want to look at this thread. There is a library called mySettings that would make building this easier.

EDIT #2

There are a couple libraries available now that do this:

这篇关于在应用程序中显示iphone应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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