2012-07-24 61 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