在開(kāi)發(fā)中有時(shí)候我們需要跳轉(zhuǎn)到本機(jī)的設(shè)置界面, 比如說(shuō)打開(kāi)定位, 藍(lán)牙等等
-
首先在info.plist文件中設(shè)置一下
屏幕快照 2016-10-24 10.58.06.png
-
在URL Schemes 選項(xiàng)中添加prefs字段, 相當(dāng)于是注冊(cè)了這個(gè)地址
然后在需要跳轉(zhuǎn)的地方添加對(duì)應(yīng)的跳轉(zhuǎn)代碼
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];
下面是常用的跳轉(zhuǎn)代碼
蜂窩網(wǎng)絡(luò):prefs:root=MOBILE_DATA_SETTINGS_IDVPN — prefs:root=General&path=Network/VPNWi-Fi:prefs:root=
WIFI定位服務(wù):prefs:root=LOCATION_SERVICES
個(gè)人熱點(diǎn):prefs:root=INTERNET_TETHERING
關(guān)于本機(jī):prefs:root=General&path=About
輔助功能:prefs:root=General&path=ACCESSIBILITY
飛行模式:prefs:root=AIRPLANE_MODE
鎖定:prefs:root=General&path=AUTOLOCK
亮度:prefs:root=Brightness
藍(lán)牙:prefs:root=General&path=Bluetooth
時(shí)間設(shè)置:prefs:root=General&path=DATE_AND_TIMEFaceTime:prefs:root=FACETIME
設(shè)置:prefs:root=General
鍵盤設(shè)置:prefs:root=General&path=KeyboardiCloud:prefs:root=CASTLEiCloud
備份:prefs:root=CASTLE&path=STORAGE_AND_BACKUP
語(yǔ)言:prefs:root=General&path=INTERNATIONAL
定位:prefs:root=LOCATION_SERVICES
音樂(lè):prefs:root=MUSICMusic
其他的功能其參考
鏈接
