2011-12-24 162 views
-3

我有肖像模式的雜誌iPad應用程序,我希望當用戶旋轉設備時,它應該處於橫向模式。但視圖應該出現在相同的位置。如何在橫向模式下製作ipad應用程序

+0

你需要更具體的你想要什麼... – Ecarrion 2011-12-24 06:14:04

+0

我希望在縱向模式下顯示的視圖也應該在橫向模式下完全相同 – user1107725 2011-12-24 07:10:18

回答

2

一般問題,但我會嘗試和涵蓋幾個關於旋轉的重要事情。

  1. 在項目設置 - iPad部署信息下,確保在支持的設備方向部分中選擇了'橫向'和'縱向'。

Supported Device Orientations

  • 如果你不希望子視圖(按鈕等)都在旋轉變化,確保取消選擇「自動調整子視圖」中你的筆尖。
  • Autoresize Subviews in Nib

  • 您可以在UIViewController類做任何額外的旋轉工作
  • -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

    否則,它會在旋轉時自動旋轉視圖及其子視圖。

    雖然嚴重,看了一些蘋果公司的文檔。這是相當廣泛的。

    +0

    通過這樣做我還必須更改按鈕或視圖的大小我正在使用肖像模式,因爲當我做到這一點看起來不一樣 – user1107725 2011-12-24 06:26:02

    +0

    那就是你可能想在'didRotateFromInterfaceOrientation制定出一個問題:(UIInterfaceOrientation)fromInterfaceOrientation'。像'myButton.frame = CGRectMake(newXPosition,newYPosition,sameWidth,sameHeight);' – johnluttig 2011-12-24 06:41:06

    相關問題