[英]UItableview and Keyboard with previous and next button scrolling issue - iPhone
在這里,我在scrollView上有一個tableView。 每行包含一個textField。 下一個按鈕還可以(在upword上動畫效果正常),但是當我按下鍵盤上的上一個按鈕時,我必須根據textField逐一顯示該視圖。 我該如何解決? 我必須在很多方面做到這一點。 請盡快幫助我。 我非常需要它。 可能是我在某處做錯了。 對不起,我的語言問題。 示例代碼可能會有所幫助。
嗨,請嘗試以下方法根據選擇的文本字段上下滾動tableview,在textfield委托方法中編寫此代碼
- (void)textFieldDidEndEditing:(UITextField *)textField{
// calculate the nsindexpath based on the textfield which is selected
//- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated;
[yourtableview scrollToRowAtIndexPath:calcutaedIndexPath atScrollPosition:UIScrollViewPositionTop animated:YES];
}
希望對您有幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.