2011-06-05 94 views
0

我有一個登錄頁面作爲模式視圖控制器呈現,當UITextField成爲縱向模式下的第一響應者時,視圖向左移動。我想知道這是爲什麼? enter image description herepresentModalView全屏視圖在顯示鍵盤時向左移動

enter image description here

的代碼非常簡單:

LoginViewController* lvc = [[LoginViewController alloc] init]; 
    lvc.delegate = self; 
[self.parentViewController presentModalViewController:lvc animated:YES]; 
[lvc release]; 

這裏面一個UIViewController稱爲其被呈現爲modalViewController以及OptionsViewController。所以基本上,我從一個modalViewController呈現modalViewController

+0

請粘貼該代碼。 – Legolas 2011-06-05 01:12:20

+0

代碼現在有 – adit 2011-06-05 01:18:24

回答

1

如果你清楚地看到第二個圖像,有一個tableView時,鍵盤出現和登錄視圖控制器(該視圖)似乎導致問題,因爲桌子。

要麼你已經從代碼(或)中的某處初始化tableView我猜你已經創建了登錄視圖控制器以及另一個TableView控制器.xib接口......所以請檢查你的代碼。

如果您的代碼沒有任何tableView初始化...請嘗試執行以下步驟。

  1. 刪除nib文件。
  2. 用相同的觀點創建一個新的,清楚地遵循相同的程序,並請讓我們張貼在結果上。
+0

在這個modalViewController後面有一個表視圖,它在應用程序啓動開始時被初始化,與這個登錄沒有任何關係 – adit 2011-06-05 01:53:56

+0

順便說一下,使用任何類型的視圖給我都一樣結果 – adit 2011-06-05 21:26:17