0
我有一個UITableView,我需要使用它的自定義鍵盤,並且出於幾個原因,我不能將它用作inputView。所以我將我的鍵盤視圖顯示爲子視圖。它的高度是260.我希望表格視圖滾動,以便選中的單元總是有一個介於0和260之間的y位置。這可能嗎?以下是我目前正在...(這是在鍵盤類)使用自定義鍵盤時,使UITableView滾動到正確的位置
-(void)showForCellAtIndexPath:(NSIndexPath*)indexPath{
[UIView beginAnimations:nil context:NULL];
self.view.frame = CGRectMake(0.0,220.0,320.0,260.0);
delegate.tableView.contentInset = UIEdgeInsetsMake(0.0,0.0,260.0,0.0);
delegate.tableView.scrollIndicatorInsets = delegate.tableView.contentInset;
delegate.view.frame = CGRectMake(0.0,-210.0, delegate.view.frame.size.width,delegate.view.frame.size.height);
[UIView commitAnimations];
[delegate.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
我會愛你的幫助。謝謝!