横竖屏问题
来源:互联网 发布:淘宝怎么打假手机 编辑:程序博客网 时间:2024/04/30 23:34
创建一个新的ViewController,xib会默认为竖屏样式768*1004 ,期望格式是1024*748.
解决方案:
此时需要进行下面的配置:
将Orientation配置为Landscape类型。之后需要在AppDelegate.m添加如下代码:if ( [[UIDevicecurrentDevice].systemVersionfloatValue] < 6.0)
{
[self.windowaddSubview:homepage.view];
}
else
{
//self.window.rootViewController = rootController;
[self.windowsetRootViewController:homepage];
}
[self.windowmakeKeyAndVisible];
[[UIApplicationsharedApplication]registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert)];
ps:Homepage为跳转的目标viewController
然后在你想跳转到的目标ViewController的.m文件(此处为Homepage.m)中添加下面两个方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return interfaceOrientation==UIInterfaceOrientationLandscapeRight || interfaceOrientation ==UIInterfaceOrientationLandscapeLeft;
}
-(NSUInteger)supportedInterfaceOrientations
{
returnUIInterfaceOrientationMaskLandscape;
}
- android横竖屏问题
- 切换横竖屏问题
- ios横竖屏问题
- 横竖屏问题
- android横竖屏问题
- zxing横竖屏问题
- 横竖屏问题总结
- 横竖屏切换问题
- 横竖屏切换问题
- iOS横竖屏问题
- 横竖屏问题
- Android横竖屏切换问题
- android 关于横竖屏问题
- Android 横竖屏切换问题
- navigationController横竖屏高度问题
- android 横竖屏问题解析
- Android横竖屏的问题
- zxing 横竖屏的问题
- oracle纵表转成横表
- jquery常用的插件1000收集
- 位图和矢量图区别
- js 定位到某个锚点
- windows修改mac地址
- 横竖屏问题
- java精确除运算,保留任意位小数
- 黑马程序员-java 面向对象【个人总结】
- gnome3的卸载,和KDE桌面和genome桌面的切换,。
- android网络通信方式
- 虚拟机系列:VMware虚拟机上网
- 解决Ubuntu下自带的Evince文档查看器中文显示问题
- web.xml 中的listener、 filter、servlet 加载顺序及其详解
- 再谈异构计算CPU+GPU