本文介绍了如何将按钮添加到一个iPhone设置页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在preferences应用程序,Safari浏览器的设置页面中包含标记清除历史记录或清除缓存按钮。邮件应用程序的设置页面包含一个大红色的删除帐户按钮。

In the Preferences app, Safari's settings page contains buttons labeled "Clear History" or "Clear Cache". The Mail App's settings page contains a big red "Delete Account" button.

有没有一种方法来创建这样与我的应用程序按钮的设置页面?我检查苹果的文档并没有发现这样的按钮元素类型。

Is there a way to create such a settings page with buttons for my app? I checked Apple's documentation and didn't find an element type for such buttons.

推荐答案

可悲的是我觉得你的运气了 - 除非你越狱。要为您的应用程序设置页面创建的plist,而不是实际的编码视图本身。这带来了一定的限制,例如不能添加一个按钮。一个核心的东西你不能做的是从设置应用程序执行任何code - 所有你能做的是改变了一套preferences的

Sadly I think you're out of luck - unless you jailbreak. To create the Settings page for your app you create a plist rather than actually coding the view itself. This brings certain restrictions such as the inability to add a button. The one core thing you can't do is to execute any code from the Settings app - all you can do is change a set of preferences.

您可以得到最接近的是与标签清除历史记录旁边的Starup添加交换机,并检查用户是否设置了此当你启动应用程序。然后,使开关设置为关闭设置中的设置。

The closest you can get is to add a switch with the label "Clear History on next starup" and check whether the user has set this whenever you start the app. Then set the settings so that the switch is set to Off.

这篇关于如何将按钮添加到一个iPhone设置页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-05 00:43