2012-07-24 62 views
0

我有一個很大的問題。在我的應用程序中,當你觸摸一個文本框時,它會出現在鍵盤上方,我的桌面視圖也會在桌面視圖中向上滾動並顯示在圖像中。圖像在滾動時增長uitableview

它運作良好。但是當我使用日返回鍵的tableview向下滾動文本框太多,但,當滾動結束,影像將返回到正確的大小

爲返回鍵代碼我的形象變得越來越大:

-(BOOL)textFieldShouldReturn:(UITextField *)textField { 

[messageField resignFirstResponder]; 
[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.3]; 
toolbar.frame = CGRectMake(0, 323, 320, 44); 
dialogueTb.frame = CGRectMake(0, 0, 320, 372); 
[UIView commitAnimations]; 
return YES; 

}

編輯:

我發現我textFieldShouldReturn問題:

沒有問題,如果我這樣做:

-(BOOL)textFieldShouldReturn:(UITextField *)textField { 

[messageField resignFirstResponder]; 
[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.3]; 
toolbar.frame = CGRectMake(0, 323, 320, 44); 
[UIView commitAnimations];<<====================== change place 
dialogueTb.frame = CGRectMake(0, 0, 320, 372); 
//[UIView commitAnimations] 
return YES; 
} 

回答

0

我的猜測是它與UIImageView的autoresizingMask有關。試試這個:

imageView.autoresizingMask = UIViewAutoresizingNone; 
+0

我有同樣的問題 – XcodeMania 2012-07-25 07:00:09

+0

好吧我找到了pb看我的編輯 – XcodeMania 2012-07-25 07:04:58