23
A
回答
86
例如:
NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"];
[[UIApplication sharedApplication] openURL:url];
而且
[font=]
About — prefs:root=General&path=About
Accessibility — prefs:root=General&path=ACCESSIBILITY
Airplane Mode On — prefs:root=AIRPLANE_MODE
Auto-Lock — prefs:root=General&path=AUTOLOCK
Brightness — prefs:root=Brightness
Bluetooth — prefs:root=General&path=Bluetooth
Date & Time — prefs:root=General&path=DATE_AND_TIME
FaceTime — prefs:root=FACETIME
General — prefs:root=General
Keyboard — prefs:root=General&path=Keyboard
iCloud — prefs:root=CASTLE
iCloud Storage & Backup — prefs:root=CASTLE&path=STORAGE_AND_BACKUP
International — prefs:root=General&path=INTERNATIONAL
Location Services — prefs:root=LOCATION_SERVICES
Music — prefs:root=MUSIC
Music Equalizer — prefs:root=MUSIC&path=EQ
Music Volume Limit — prefs:root=MUSIC&path=VolumeLimit
Network — prefs:root=General&path=Network
Nike + iPod — prefs:root=NIKE_PLUS_IPOD
Notes — prefs:root=NOTES
Notification — prefs:root=NOTIFICATIONS_ID
Phone — prefs:root=Phone
Photos — prefs:root=Photos
Profile — prefs:root=General&path=ManagedConfigurationList
Reset — prefs:root=General&path=Reset
Safari — prefs:root=Safari
Siri — prefs:root=General&path=Assistant
Sounds — prefs:root=Sounds
Software Update — prefs:root=General&path=SOFTWARE_UPDATE_LINK
Store — prefs:root=STORE
Twitter — prefs:root=TWITTER
Usage — prefs:root=General&path=USAGE
VPN — prefs:root=General&path=Network/VPN
Wallpaper — prefs:root=Wallpaper
Wi-Fi — prefs:root=WIFI`
prefs:root=INTERNET_TETHERING
6
8
显然,这并不在iOS的5.1工作任何。我一直在整个上午的战斗,然后过这个博客跑
26
打开设置应用程序是只能从iOS版8.因此,使用下面的代码...
if([CLLocationManager locationServicesEnabled]&&
[CLLocationManager authorizationStatus] != kCLAuthorizationStatusDenied)
{
//...Location service is enabled
}
else
{
if([[[UIDevice currentDevice] systemVersion] floatValue]<8.0)
{
UIAlertView* curr1=[[UIAlertView alloc] initWithTitle:@"This app does not have access to Location service" message:@"You can enable access in Settings->Privacy->Location->Location Services" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[curr1 show];
}
else
{
UIAlertView* curr2=[[UIAlertView alloc] initWithTitle:@"This app does not have access to Location service" message:@"You can enable access in Settings->Privacy->Location->Location Services" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Settings", nil];
curr2.tag=121;
[curr2 show];
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSLog(@"buttonIndex:%d",buttonIndex);
if (alertView.tag == 121 && buttonIndex == 1)
{
//code for opening settings app in iOS 8
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}
}
+0
是否可以转到设置应用程序的常规顶层,而不是您的应用程序的设置选项? – zonabi 2015-06-03 20:46:22
+1
没有@zonabi,iOS SDK没有提供任何选项。 – 2015-06-04 07:33:27
1
它适用于iOS8上+还,但我们需要改变一些东西
NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"];
if([[UIApplication sharedApplication] canOpenURL:url]){
[[UIApplication sharedApplication] openURL:url];
}
相关问题
- 1. 如何在iOS中将图像设置为uialertview按钮?
- 2. IAP iOS UIAlertView取消按钮
- 3. 通过UIAlertView按钮打开iOS电子邮件应用程序
- 4. iOS 8 UIAlertView不显示按钮
- 5. 移动按钮UIAlertView中
- 6. UIAlertView按钮标记
- 7. UIAlertView按钮操作?
- 8. 如何清除iOS中UIAlertView中的UITextfield文本和Ok按钮?
- 9. iOS设置屏幕UIAlertView(最好在按'后退'时)
- 10. iOS 8中的UIAlertView按钮标题变白白
- 11. TextField覆盖UIAlertView的按钮
- 12. 带19个按钮的UIAlertView
- 13. 属性在uialertview中启用了按钮
- 14. iOS按钮设计
- 15. 在Cakephp中设置按钮与按钮
- 16. UIAlertView中的iOS UISlider
- 17. UIAlertView中 - 在IOS
- 18. UIAlertView其他按钮标题
- 19. UIAlertView没有任何按钮
- 20. 设置按钮
- 21. UIAlertView按钮事件问题
- 22. 禁用UIAlertView按钮是否会拒绝我的应用程序?
- 23. 更改UIAlertView按钮布局
- 24. UIAlertView无取消按钮?
- 25. 如何在iOS 8上显示没有按钮的UIAlertView?
- 26. Like按钮在iOS应用程序中
- 27. 更改UIAlertView中取消按钮的位置?
- 28. 的iOS:设置按钮按下的状态
- 29. React-Native:如何在应用程序设置iOS中添加按钮?
- 30. 使用UIAlertView检测按钮单击
我是测试这一点,并意识到它只是工作在ios 5.我在iPhone 3G上进行测试,而不是S。我知道它的老哈哈,有没有iOS 4的方法?还是仅限于支持iOS 5多任务的设备? – 2012-02-01 08:09:19
是的,它只适用于ios 5. – 2012-02-01 08:16:45
是公共API吗? – Undo 2013-04-28 21:57:51