Open Settings.app When Button is Tapped in UIAlertView on iPhone SDK [duplicate]
来源:互联网 发布:域名注册可靠吗 编辑:程序博客网 时间:2024/06/05 02:29
There is no way to do this.
Because till now (11th Jan 2013) there is no url scheme available for settings app.
So you can't do it on ios6
on ios5 (< 5.1): Call the official *Settings* app from my app on iPhone
ios7无法实现自定制弹出筐体点击按钮后进入settings页面。但是ios8开始就提供了这个支持了
这是IOS8之后的一个新特性:即可以直接在应用内,跳转到应用的setting设置中,然后进行相应的操作!
eg:判断是否开启定位服务而言,如果没开启,则弹出alertview,跳转到设置中,代码如下:
if([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0){ UIAlertView *tipMessage = [[UIAlertView alloc] initWithTitle:@"定位服务已关闭" message:kCLMessage_AppDenied delegate:self cancelButtonTitle:nil otherButtonTitles:@"知道了", nil]; tipMessage.tag = 1001; [tipMessage show]; }else{ UIAlertView *tipSettingMessage=[[UIAlertView alloc] initWithTitle:@"定位服务已关闭" message:kCLMessage_AppDenied delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"设置", nil]; tipSettingMessage.tag=1002; [tipSettingMessage show]; }
- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (alertView.tag == 1002 && buttonIndex == 1){ //code for opening settings app in iOS 8 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; }}
这是IOS8之后的一个新特性:即可以直接在应用内,跳转到应用的setting设置中,然后进行相应的操作!
eg:判断是否开启定位服务而言,如果没开启,则弹出alertview,跳转到设置中,代码如下:
if([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0){ UIAlertView *tipMessage = [[UIAlertView alloc] initWithTitle:@"定位服务已关闭" message:kCLMessage_AppDenied delegate:self cancelButtonTitle:nil otherButtonTitles:@"知道了", nil]; tipMessage.tag = 1001; [tipMessage show]; }else{ UIAlertView *tipSettingMessage=[[UIAlertView alloc] initWithTitle:@"定位服务已关闭" message:kCLMessage_AppDenied delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"设置", nil]; tipSettingMessage.tag=1002; [tipSettingMessage show]; }
- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (alertView.tag == 1002 && buttonIndex == 1){ //code for opening settings app in iOS 8 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; }}
0 0
- Open Settings.app When Button is Tapped in UIAlertView on iPhone SDK [duplicate]
- 被苹果驳回,We discovered one or more bugs in your app when reviewed on iPhone......
- [IPhone][SDK][控件]自定义UIAlertView
- iPhone SDK开发:自定义UIAlertView
- iPhone SDK开发:自定义UIAlertView
- How to find indexPath for tapped button in tableView Using Seque
- Publish button is not displayed when you create a site based on the Publishing Portal site template in SharePoint Server 2007
- Cannot insert explicit value for identity column in table 'settings' when IDENTITY_INSERT is set to OFF.
- Cannot insert explicit value for identity column in table 'settings' when IDENTITY_INSERT is set to OFF.
- UIAlertView is deprecated in ios9
- You can open settings app programmatically in iOS8, but not in earlier versions of iOS.
- base64 on iphone-sdk
- Windows - How to open the Settings app from the Command Prompt in Windows 10
- “Failed to upload *.app on Device ” Error in iPhone
- date(): It is not safe to rely on the system's timezone settings in CodeIgniter
- AutoScrollManager Class: Scroll scrollbar when mouse is moving in a specified area and mouse button is down
- android sdk manager settings on os (mac)
- UIAlertView is deprecated in iOS 8.
- 第13章红黑树思路梳理
- Apple 企业开发者账号&邓白氏码申请记录
- 输出一个字符串的全排列
- java map的遍历
- linux内核模型---总线,设备,驱动在展讯平台上I2C设备的实例解析
- Open Settings.app When Button is Tapped in UIAlertView on iPhone SDK [duplicate]
- AS 选项切换效果
- 【leetcode】Compare Version Numbers
- 简易连连看
- 资源打包Assetbundle
- 一个纯C#的Lua 5.2实现
- Jsoup 问题
- [Leetcode]Linked List Cycle
- 第七周项目 1 实现复数类中的运算符重载(1)