开机动画 开灯关灯
来源:互联网 发布:生产流程优化重点 编辑:程序博客网 时间:2024/05/21 06:20
开灯关灯
if(sender.selected) {
[sender setTitle:@"关灯"forState:UIControlStateNormal];
[device setTorchMode:AVCaptureTorchModeOn];
[device setFlashMode:AVCaptureFlashModeOn];
} else {
[sender setTitle:@"开灯"forState:UIControlStateNormal];
[device setTorchMode:AVCaptureTorchModeOff];
[device setFlashMode:AVCaptureFlashModeOff];
}
[sender setTitle:@"关灯"forState:UIControlStateNormal];
[device setTorchMode:AVCaptureTorchModeOn];
[device setFlashMode:AVCaptureFlashModeOn];
} else {
[sender setTitle:@"开灯"forState:UIControlStateNormal];
[device setTorchMode:AVCaptureTorchModeOff];
[device setFlashMode:AVCaptureFlashModeOff];
}
[deviceunlockForConfiguration];
开机动画,或者再window上写,不过需要纯代码创建window
staticdispatch_once_tonceToken;
dispatch_once(&onceToken, ^{
// 开机启动动画
UIImageView*splashView = [[UIImageViewalloc]initWithFrame:CGRectMake(0,0,ScreenWidth,ScreenHeight)];
//将图片添加到UIImageView对象中
splashView.image=[UIImageimageNamed:@"bg_night_snow"];
[self.viewaddSubview:splashView];
[self.viewbringSubviewToFront:splashView];
[UIView animateWithDuration:4.fanimations:^{
self.navigationController.navigationBar.hidden= YES;
splashView.frame=CGRectMake(-55/375. * ScreenWidth, -100./ 667 *ScreenHeight,ScreenWidth + 100,ScreenHeight + 100+100);
} completion:^(BOOLfinished) {
splashView.hidden= YES;
self.navigationController.navigationBar.hidden= NO;
// 开机启动动画
UIImageView*splashView = [[UIImageViewalloc]initWithFrame:CGRectMake(0,0,ScreenWidth,ScreenHeight)];
//将图片添加到UIImageView对象中
splashView.image=[UIImageimageNamed:@"bg_night_snow"];
[self.viewaddSubview:splashView];
[self.viewbringSubviewToFront:splashView];
[UIView animateWithDuration:4.fanimations:^{
self.navigationController.navigationBar.hidden= YES;
splashView.frame=CGRectMake(-55/375. * ScreenWidth, -100./ 667 *ScreenHeight,ScreenWidth + 100,ScreenHeight + 100+100);
} completion:^(BOOLfinished) {
splashView.hidden= YES;
self.navigationController.navigationBar.hidden= NO;
}];
});
0 0
- 开机动画 开灯关灯
- 开灯关灯问题
- 开灯?关灯?那种方式更省电?
- iOS开灯和关灯代码
- JS——开灯关灯
- poj 1222 关灯开灯问题 暴搜
- 【GZOJ】1308——开灯关灯
- android控件 ToggleButton-开关开灯关灯
- UVa Problem 10110 Light, More Light (开灯与关灯)
- Js控制css——模仿视频网站关灯开灯
- Js控制css——模仿视频网站关灯开灯
- 简单的JavaScript实现开灯关灯效果 ↑_↑
- 优酷新版播放器,开灯关灯特效
- 关灯
- 笔试题 百度2015大数据云计算研发笔试(关灯开灯)
- 开机动画
- 开机动画
- 开机动画
- 奇偶数分离
- Android的onCreateOptionsMenu()创建菜单Menu详解
- xcode 弹出的错误 1 <Xcode cannot launch apps on the simulated device “iPhone 5s”, as it is cur>
- jQuery使用小结
- 浅谈Service Manager成为Android进程间通信(IPC)机制Binder守护进程之路
- 开机动画 开灯关灯
- 一步一步写平衡二叉树(AVL树)
- 做c语言的码农专业发展方向
- 对于javascript中 history.go back的总结
- Fibonacci数
- 机器学习实战代码学习(K-近邻算法)
- Deep Learning 备忘与总结
- MySQL 5.6 for Windows 解压缩版配置安装
- 数据解析