iOS开发之调用系统设置

调整屏幕亮度

  [[UIScreen mainScreen] setBrightness:0.5];

 

调用系统设置

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

 

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

一些其他可用的参数:

 

  • 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//

 

UIAlertController 的使用

UIAlertController*alert=[UIAlertController alertControllerWithTitle:@"警告框" message:nil preferredStyle:UIAlertControllerStyleAlert];

    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

        NSLog(@"确定");

    }]];

    [alert addAction:[UIAlertAction actionWithTitle:@"警示性" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {

        NSLog(@"不确定");

    }]];

    [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

        NSLog(@"取消");

    }]];

    [self presentViewController:al animated:YES completion:nil];

 

转载于:https://www.cnblogs.com/fantasy940155655/p/5715792.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值