How to move tableView up inorder to popUp a view from bottom So that it is not on top of table in iPhone
I have a tableView.It exists from half portion of iPhone screen to bottom.If I click any cell a popup comes up from bottom. When it appear开发者_如何学JAVAs on the screen table should move up,So that popup does not overlap on tableView.
Can anyone suggest How to do this.
Thanks in Advance.
Set,
CGPoint _contentOffset = CGPointMake(tableView.contentOffset.x, aNegativeYValue);
tableView.contentOffset = _contentOffset;
If you want it animated, use,
CGPoint _contentOffset = CGPointMake(tableView.contentOffset.x, aNegativeYValue);
[tableView setContentOffset:_contentOffset animated:YES];
You can also use table view's scrollToRowAtIndexPath:atScrollPosition:animated: method.
The simplest way is to embed your tableView (and your other views, since you apparently have more than one view on screen) in a UIScrollView
.
Then when you present the popup window on screen, calculate an offset to scroll to by getting your popup window's size,
then slide up the tableView using [scrollView setContentOffset:MyOffset animated:YES]
.
精彩评论