我正在使用UITextView,如果文本在鍵盤下方展開,則無法滾動,如下圖所示。因此,如果文本與鍵盤一致或位於鍵盤下方,我需要某種滾動方式向下滾動視圖。我找過類似的例子/教程,但沒有找到任何適合我的項目的好東西。如何在UITextView中實現滾動功能?
我會發布我在我的.h文件中如何在下面實現了我的UITextView * commentField。我應該從這裏做什麼?如果你可以成爲一個具體的示例代碼,將不勝感激! /問候
http://tinypic.com/view.php?pic=kck6t&s=6
ReportViewController.h文件:
@interface ReportViewController : MLUIViewController <MLReportErrorDelegate, UITextFieldDelegate, UIGestureRecognizerDelegate>
{
IBOutlet UITextView *commentField;
IBOutlet UITextField *emailField;
}
@property (nonatomic, retain) UITextView *commentField;
ReportViewController.m文件:
- (void) textViewShouldBeginEditing:(UITextView *)commentField
{
???????????????????????
}