Re: [iPhone] How to scroll to UITableView footer view
contentSize is the correct way to do this. It gives a ‘buffer zone’ at the top and bottom (and sides if you wish) on the scroll view. On May 1, 2010, at 11:04 PM, Luke the Hiesterman wrote: > UITableView is a subclass of UIScrollView. So, you can ask for its > contentSize and then call scrollRectToVisible:animated: with a rect that lies > at the end of the contentSize. > > Luke > > On May 1, 2010, at 7:52 PM, Tharindu Madushanka wrote: > >> Hi, >> >> How can I scroll to a UITableView footer all the time, while adding cells to >> table view content. >> >> Is there some way similar to scrollToRowAtIndexPath: , to scroll directly >> into my bottom footer view after adding new cells ? >> >> Thank you and Kind Regards, >> >> Tharindu Madushanak >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com >> >> This email sent to luket...@apple.com > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com > > This email sent to sc...@cocoadoc.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] How to scroll to UITableView footer view
if by footer view, you mean content that is at the end of a table view, I suggest you read the UIScrollView Guide, specifically the issues regarding contentOffset. On May 2, 2010, at 11:14 AM, Scott Andrew wrote: > What about making the rect your view's actual bounds. Something like... > > CGRect footerBounds = [footerView bounds]; > CGRect footerRectInTable = [tableView convertRect:footerBounds > fromView:footerView]; > > [tableView scrollToRect:footerRectInTable animated:YES]; > > This should scroll to the footer view since you are basing it on the footer > view's current bounds after you call endUpdate. If all is added and adjusted. > > Scott > > On May 1, 2010, at 8:13 PM, Tharindu Madushanka wrote: > >> Actually this doesn't seem to scroll to footer view :( >> >> Following is the code I have, i am continuously adding cells. Now I want to >> scroll to bottom footer view. Following code doesn't seem to scroll to the >> most bottom footer view. >> >> [tableview beginUpdates]; >> [tableview insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath >> indexPathForRow:(chatMessages.count - 1) inSection:0]] >> withRowAnimation:UITableViewRowAnimationLeft]; >> [tableview endUpdates]; >> >> if (tableview.tableFooterView) >> [tableview scrollRectToVisible:CGRectMake(0, >> tableview.contentSize.height+64, 320, 44) animated:YES]; >> >> >> Tharindu Madushanka >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com >> >> This email sent to scottand...@roadrunner.com > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com > > This email sent to sc...@cocoadoc.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] How to scroll to UITableView footer view
What about making the rect your view's actual bounds. Something like... CGRect footerBounds = [footerView bounds]; CGRect footerRectInTable = [tableView convertRect:footerBounds fromView:footerView]; [tableView scrollToRect:footerRectInTable animated:YES]; This should scroll to the footer view since you are basing it on the footer view's current bounds after you call endUpdate. If all is added and adjusted. Scott On May 1, 2010, at 8:13 PM, Tharindu Madushanka wrote: > Actually this doesn't seem to scroll to footer view :( > > Following is the code I have, i am continuously adding cells. Now I want to > scroll to bottom footer view. Following code doesn't seem to scroll to the > most bottom footer view. > > [tableview beginUpdates]; > [tableview insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath > indexPathForRow:(chatMessages.count - 1) inSection:0]] > withRowAnimation:UITableViewRowAnimationLeft]; > [tableview endUpdates]; > > if (tableview.tableFooterView) >[tableview scrollRectToVisible:CGRectMake(0, > tableview.contentSize.height+64, 320, 44) animated:YES]; > > > Tharindu Madushanka > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com > > This email sent to scottand...@roadrunner.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] How to scroll to UITableView footer view
Actually this doesn't seem to scroll to footer view :( Following is the code I have, i am continuously adding cells. Now I want to scroll to bottom footer view. Following code doesn't seem to scroll to the most bottom footer view. [tableview beginUpdates]; [tableview insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:(chatMessages.count - 1) inSection:0]] withRowAnimation:UITableViewRowAnimationLeft]; [tableview endUpdates]; if (tableview.tableFooterView) [tableview scrollRectToVisible:CGRectMake(0, tableview.contentSize.height+64, 320, 44) animated:YES]; Tharindu Madushanka ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] How to scroll to UITableView footer view
On 1 May 2010, at 9:52 PM, Tharindu Madushanka wrote: > How can I scroll to a UITableView footer all the time, while adding cells to > table view content. > > Is there some way similar to scrollToRowAtIndexPath: , to scroll directly > into my bottom footer view after adding new cells ? What success do you have with -[UIScrollView scrollRectToVisible:animated:], using a CGRect calculated from the scroll view's contentSize? UITableView is a UIScrollView. Always look for the properties and methods of the superclasses. — F ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] How to scroll to UITableView footer view
UITableView is a subclass of UIScrollView. So, you can ask for its contentSize and then call scrollRectToVisible:animated: with a rect that lies at the end of the contentSize. Luke On May 1, 2010, at 7:52 PM, Tharindu Madushanka wrote: > Hi, > > How can I scroll to a UITableView footer all the time, while adding cells to > table view content. > > Is there some way similar to scrollToRowAtIndexPath: , to scroll directly > into my bottom footer view after adding new cells ? > > Thank you and Kind Regards, > > Tharindu Madushanak > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com > > This email sent to luket...@apple.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
[iPhone] How to scroll to UITableView footer view
Hi, How can I scroll to a UITableView footer all the time, while adding cells to table view content. Is there some way similar to scrollToRowAtIndexPath: , to scroll directly into my bottom footer view after adding new cells ? Thank you and Kind Regards, Tharindu Madushanak ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com