美文网首页iOS开发
iOS开发过程中从App 中跳到设置等页面

iOS开发过程中从App 中跳到设置等页面

作者: 这人很懒 | 来源:发表于2016-04-07 14:05 被阅读484次

在iOS开发过程中经常会有一些从App 中直接跳转到设置页面等去进行一定的功能设置需求。尤其是对App 的各种权限的设置等等 …… 下面就列举几个简单的例子

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

if([[UIApplication sharedApplication] canOpenURL:url]) {

[[UIApplication sharedApplication] openURL:url];

在iOS应用程序中打开设备设置界面及其中某指定的选项界面

[[UIApplicationshared Application] openURL:[NSURL URLWithString:@"prefs:root=General"]];

[[UIApplicationshared Application] openURL:[NSURL URLWithString:@"prefs:root=General&path=Restrictions"]];

一些其他可用的参数:

List of currently known URLs in the Settings app:

prefs:root=General&path=About//关于

prefs:root=General&path=ACCESSIBILITY//重力感应

prefs:root=AIRPLANE_MODE//飞行模式

prefs:root=General&path=AUTOLOCK//自动锁定

prefs:root=General&path=USAGE/CELLULAR_USAGE//用量

prefs:root=Brightness//亮度调节

prefs:root=General&path=Bluetooth//蓝牙

prefs:root=General&path=DATE_AND_TIME//时间和日期

prefs:root=FACETIME//

prefs:root=General//通用

prefs:root=General&path=Keyboard//键盘

prefs:root=CASTLE//

prefs:root=CASTLE&path=STORAGE_AND_BACKUP//

prefs:root=General&path=INTERNATIONAL//

prefs:root=LOCATION_SERVICES//

prefs:root=ACCOUNT_SETTINGS//

prefs:root=MUSIC//

prefs:root=MUSIC&path=EQ//

prefs:root=MUSIC&path=VolumeLimit//

prefs:root=General&path=Network//

prefs:root=NIKE_PLUS_IPOD//

prefs:root=NOTES//

prefs:root=NOTIFICATIONS_ID//

prefs:root=Phone//

prefs:root=Photos//

prefs:root=General&path=ManagedConfigurationList//

prefs:root=General&path=Reset//

prefs:root=Sounds&path=Ringtone//

prefs:root=Safari//

prefs:root=General&path=Assistant//

prefs:root=Sounds//

prefs:root=General&path=SOFTWARE_UPDATE_LINK//

prefs:root=STORE//

prefs:root=TWITTER//

prefs:root=General&path=USAGE//

prefs:root=VIDEO//

prefs:root=General&path=Network/VPN//

prefs:root=Wallpaper//

prefs:root=WIFI//

prefs:root=INTERNET_TETHERING//

相关文章

网友评论

    本文标题:iOS开发过程中从App 中跳到设置等页面

    本文链接:https://www.haomeiwen.com/subject/rwgmlttx.html