IOS 横屏 打开相册 问题
来源:互联网 发布:try pink知乎 编辑:程序博客网 时间:2024/06/04 19:09
IOS 竖屏 打开相册 是完全没问题的,也没有什么警告
UIImagePickerController
用于 相机 相册 照片 iOS API中明确指出只适合竖屏状态下打开忙了2天终于找到问题所在
在 例子中添加这么两句就可以较好解决 但还是有警告
定义
@interface IOSAlbumCameraController :UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
- (BOOL) shouldAutorotate;
- (NSUInteger)supportedInterfaceOrientations;
@end
实现 添加到具体代码里
- (BOOL) shouldAutorotate {
returnYES;
}
- (NSUInteger)supportedInterfaceOrientations {
returnUIInterfaceOrientationMaskAll;
}
虽然还有警告但至少过了 可以横屏出了。
这里要注意的一点是 Unity的 旋转 要设置为自由旋转然后全选 四种
然后 修改这里 就可以了,暂时没时间看为什么 先记下来 有时间再看
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window{// UIInterfaceOrientationMaskAll// it is the safest way of doing it:// - GameCenter and some other services might have portrait-only variant// and will throw exception if portrait is not supported here// - When you change allowed orientations if you end up forbidding current one// exception will be thrown// Anyway this is intersected with values provided from UIViewController, so we are good//return (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationPortraitUpsideDown)// | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationLandscapeLeft); return UIInterfaceOrientationMaskLandscape;}
还有 有个地方最好也要横屏出现 要不 每次实现窗口就会 旋转能看到不适很好
UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = type; picker.allowsEditing = flag; picker.modalPresentationStyle = UIModalPresentationCurrentContext;
就是最后一句 要横屏。
0 0
- IOS 横屏 打开相册 问题
- iOS 打开设备相册
- IOS 打开本地相册
- iOS 打开相机、相册
- iOS 11打开系统相册列表向上偏移问题
- iOS 打开相册或相机
- IOS 横屏打开相册
- iOS 打开相册,保存图片到相册,打开相机
- iOS开发:iOS10.2手机系统打开相册遇到的各种显示英文文字的问题
- iOS 打开系统相册和使用相机
- iOS 打开系统相册和使用相机
- iOS 打开iPhone照相机和相册
- iOS ---打开iPhone照相机和相册
- iOS 取相册照片/打开相机
- iOS选择照片、相册问题
- Android打开系统相册的问题
- Android打开系统相册的问题
- Android打开系统相册的问题
- String整合Hibernate Hql出现user is not mapped [FROM USER WHERE username =? and password=?
- QT中LineEdit怎么设置不显示明文
- postgreSQL数据库导入导出
- uCOS-II整理之任务的同步与通信
- 11. Hibernate_单向多对一映射
- IOS 横屏 打开相册 问题
- sizeof的作用
- Windows下Apache httpd搭建代理服务器
- 利用selenium时,chrome和firfox使用代理ip
- MyBatis入门小程序
- 关于g2o的学习使用
- Scala入门到精通
- dns服务器常用地址
- hadoop命令大全