有時(shí)候焰雕,我們希望用戶跳轉(zhuǎn)到設(shè)置界面,進(jìn)行一些設(shè)置。這個(gè)時(shí)候該如何跳轉(zhuǎn)呢膊升?
iOS8下跳轉(zhuǎn)到設(shè)置界面方式:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
這種方式雖然能跳轉(zhuǎn)到設(shè)置界面,但是不能跳轉(zhuǎn)到具體的頁(yè)面如何跳到指定的設(shè)置界面谭企,例如設(shè)置WiFi的時(shí)候廓译,想直接跳到WiFi設(shè)置界面。
在URL Types 添加 一個(gè)叫prefs的URL
Schemes,如圖:
添加URL Schemes
在適當(dāng)?shù)臅r(shí)候债查,調(diào)用此方法跳轉(zhuǎn)到對(duì)應(yīng)的設(shè)置界面
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"跳轉(zhuǎn)不同界面對(duì)應(yīng)的URLString"]];詳見(jiàn)如下:
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
注意非区,按照要求拼接好跳轉(zhuǎn)的URLString,就可以實(shí)現(xiàn)對(duì)應(yīng)界面的跳轉(zhuǎn)。