如何在用户按下按钮时打开“设置”应用程序? [英] How can I open the Settings app when the user presses a button?

查看:116
本文介绍了如何在用户按下按钮时打开“设置”应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的理解,使用这样的代码:

From what I understand by using code like this:

NSURL* appUrl = [NSURL URLWithString: @"URL"];
[[UIApplication sharedApplication] openURL:appUrl];

当用户说我可以打开地图,YouTube,Safari,邮件,iTunes和App Store按下按钮。

I can open Map, YouTube, Safari, Mail, iTunes and the App Store, when a user say presses a button.

但我想知道是否可以使用此方法打开设置应用。

But I was wondering is it possible to open the Settings app with this method.

基本上,当用户第一次打开我的应用程序时,我想要弹出一个UIAlertView,让用户知道他们可以根据需要更改特定设置,然后按OK或者按设置将他们带到设置应用程序。

Basically, the first time the user opens my app I want a UIAlertView to pop up to let the user know that they can change a specific setting if they want, and either they press OK or they press settings to take them to the settings app.

我知道Apple在某些情况下会这样做,但开发人员是否可以这样做?

I know that Apple do that in some situations, but is it possible for developers to do that?

推荐答案

根据@ bnduati的回答,在iOS 8中,您可以使用以下代码在设置应用中打开应用程序的设置:

As per @bnduati's answer, in iOS 8 you can use the following code to open your app's settings in the settings app:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];






旧答案:


Old answer:

从iOS 5.1到iOS 7,无法从其他应用程序打开设置应用程序。

From iOS 5.1 through iOS 7, it was not possible to open the settings app from another application.

您可能想调查此框架用于提供应用内设置。

You might want to investigate this framework for providing in-app settings.

那里还有很多其他问题可以讨论这个话题:

There are quite a few other questions that discuss this topic:

iPhone - 如何将通过系统设置应用程序看到的设置包放入您自己的应用程序中?

从应用程序启动iPhone设置界面?

如何将用户从iPhone应用程序中发送到主iPhone设置屏幕

这篇关于如何在用户按下按钮时打开“设置”应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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