升級xcode5.1 iOS 6.0后以前的橫屏項目 變為了豎屏

升級xcode5.1 ? iOS 6.0后以前的橫屏項目 變為了豎屏,以下為解決辦法:

在AppDelegate 的初始化方法

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中

[window addSubview: viewController.view];

替換為下面代碼:

if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)

{ // warning: addSubView doesn't work on iOS6

[window addSubview: viewController.view];

}

else

{ // use this mehod on ios6

[window setRootViewController:viewController];

}

在RootViewController 中添加下面兩個方法 即可:

- (NSUInteger) supportedInterfaceOrientations{

return UIInterfaceOrientationMaskLandscape;

}

- (BOOL) shouldAutorotate {

return YES;

}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/388248.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/388248.shtml
英文地址,請注明出處:http://en.pswp.cn/news/388248.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

動漫數據推薦系統

Simple, TfidfVectorizer and CountVectorizer recommendation system for beginner.簡單的TfidfVectorizer和CountVectorizer推薦系統&#xff0c;適用于初學者。 目標 (The Goal) Recommendation system is widely use in many industries to suggest items to customers. F…

Wait Event SQL*Net more data to client

oracle 官方給的說法是 C.3.152 SQL*Net more data to client The server process is sending more data/messages to the client. The previous operation to the client was also a send. Wait Time: The actual time it took for the send to complete 意味著server process…

1.3求根之牛頓迭代法

目錄 目錄前言&#xff08;一&#xff09;牛頓迭代法的分析1.定義2.條件3.思想4.誤差&#xff08;二&#xff09;代碼實現1.算法流程圖2.源代碼&#xff08;三&#xff09;案例演示1.求解&#xff1a;\(f(x)x^3-x-10\)2.求解&#xff1a;\(f(x)x^2-1150\)3.求解&#xff1a;\(f…

libzbar.a armv7

楊航最近在學IOS&#xfeff;&#xfeff; http://download.csdn.net/download/lzwxyz/5546365 我現在用的是這個&#xff1a;http://www.federicocappelli.net/2012/10/05/zbar-library-for-iphone-5-armv7s/ 點它的HERE開始下載 下載的libzbar.a庫&#xff0c;如何查看 …

Alex Hanna博士:Google道德AI小組研究員

Alex Hanna博士是社會學家和研究科學家&#xff0c;致力于Google的機器學習公平性和道德AI。 (Dr. Alex Hanna is a sociologist and research scientist working on machine learning fairness and ethical AI at Google.) Before that, she was an Assistant Professor at th…

三位對我影響最深的老師

我感覺&#xff0c;教過我的老師們&#xff0c;不論他們技術的好壞對我都是有些許影響的。但是讓人印象最深的好像只有寥寥幾位。 第一位就是小學六年級下冊教過我的語文老師。他是臨時從一個貧困小學調任過來的&#xff0c;不怎么管班級&#xff0c;班里同學都在背地里說他不會…

安全開發 | 如何讓Django框架中的CSRF_Token的值每次請求都不一樣

前言 用過Django 進行開發的同學都知道&#xff0c;Django框架天然支持對CSRF攻擊的防護&#xff0c;因為其內置了一個名為CsrfViewMiddleware的中間件&#xff0c;其基于Cookie方式的防護原理&#xff0c;相比基于session的方式&#xff0c;更適合目前前后端分離的業務場景&am…

UNITY3D 腦袋頂血頂名

&#xfeff;&#xfeff;楊航最近在學Unity3D&#xfeff;&#xfeff; using UnityEngine; using System.Collections; public class NPC : MonoBehaviour { //主攝像機對象 public Camera camera; //NPC名稱 private string name "我是doud…

一個項目的整個測試流程

最近一直在進行接口自動化的測試工作&#xff0c;同時對于一個項目的整個測試流程進行了梳理&#xff0c;希望能對你有用~~~ 需求分析&#xff1a; 整體流程圖&#xff1a; 需求提取 -> 需求分析 -> 需求評審 -> 更新后的測試需求跟蹤xmind 分析流程&#xff1a; 1. 需…

python度量學習_Python的差異度量

python度量學習Hi folks, welcome back to my new edition of the blog, thank you so much for your love and support, I hope you all are doing well. In today’s learning, we will try to understand about variance and the measures involved in it. Although the blo…

多個攝像機之間的切換

楊航最近在學Unity3D&#xfeff;&#xfeff; Unity3D入門 第捌章: 多個攝像機之間的切換 內容描述&#xff1a;這章&#xff0c;我們來學習一下同個場景中多個攝像機怎么切換。 接著我們創建一個空對象 GameObject -> Create Empty 命名為CamearController&#xff0…

Kubernetes的共享GPU集群調度

問題背景 全球主要的容器集群服務廠商的Kubernetes服務都提供了Nvidia GPU容器調度能力&#xff0c;但是通常都是將一個GPU卡分配給一個容器。這可以實現比較好的隔離性&#xff0c;確保使用GPU的應用不會被其他應用影響&#xff1b;對于深度學習模型訓練的場景非常適合&#x…

django-celery定時任務以及異步任務and服務器部署并且運行全部過程

Celery 應用Celery之前&#xff0c;我想大家都已經了解了&#xff0c;什么是Celery&#xff0c;Celery可以做什么&#xff0c;等等一些關于Celery的問題&#xff0c;在這里我就不一一解釋了。 應用之前&#xff0c;要確保環境中添加了Celery包。 pip install celery pip instal…

網頁視頻15分鐘自動暫停_在15分鐘內學習網頁爬取

網頁視頻15分鐘自動暫停什么是網頁抓取&#xff1f; (What is Web Scraping?) Web scraping, also known as web data extraction, is the process of retrieving or “scraping” data from a website. This information is collected and then exported into a format that …

Unity3D面試ABC

Unity3D面試ABC 楊航最近在學Unity3D&#xfeff;&#xfeff; 最先執行的方法是&#xff1a; 1、&#xff08;激活時的初始化代碼&#xff09;Awake&#xff0c;2、Start、3、Update【FixUpdate、LateUpdate】、4、&#xff08;渲染模塊&#xff09;OnGUI、5、再向后&#xff…

前嗅ForeSpider教程:創建模板

今天&#xff0c;小編為大家帶來的教程是&#xff1a;如何在前嗅ForeSpider中創建模板。主要內容有&#xff1a;模板的概念&#xff0c;模板的配置方式&#xff0c;模板的高級選項&#xff0c;具體內容如下&#xff1a; 一&#xff0c;模板的概念 模板列表的層級相當于網頁跳轉…

2.PHP利用PDO連接方式連接mysql數據庫

代碼如下 <?php$serverName "這里填IP地址";$dbName "這里填數據庫名";$userName "這里填用戶名&#xff08;默認為root&#xff09;";$password "";/*密碼默認不用填*/try { $conn new PDO("mysql:host$serverName;…

django 性能優化_優化Django管理員

django 性能優化Managing data from the Django administration interface should be fast and easy, especially when we have a lot of data to manage.從Django管理界面管理數據應該快速簡便&#xff0c;尤其是當我們要管理大量數據時。 To improve that process and to ma…

3D場景中選取場景中的物體。

楊航最近在學Unity3D&#xfeff;&#xfeff;&#xfeff;&#xfeff;在一些經典的游戲中&#xff0c;需要玩家在一個3D場景中選取場景中的物體。例如《仙劍奇俠傳》&#xff0c;選擇要攻擊的敵人時、為我方角色增加血量、為我方角色添加狀態&#xff0c;通常我們使用鼠標來選…

xpath之string(.)方法

from lxml import etreehtml <li class"tag_1">需要的內容1<a>需要的內容2</a></li> selector etree.HTML(html ) contents selector.xpath ( //li[class "tag_1"]) contents1 selector.xpath ( //li[class "tag…