【发布时间】:2010-11-06 02:43:27
【问题描述】:
我有一个 UITableView,我需要使用自定义键盘,由于某些原因,我不能将它用作 inputView。所以我的键盘视图显示为子视图。它的高度是 260。我希望表格视图滚动,以便所选单元格的 y 位置始终在 0 到 260 之间。这可能吗?这是我目前正在尝试的......(这是在键盘类中)
-(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];
}
我很想得到你的帮助。谢谢!
【问题讨论】: