Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 06-22-2010, 03:56 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 25
s.newave is on a distinguished road
Question How to expand tablecell with new content without using reloadRowsAtIndex?

Hi, tried posting this question on some other forums with no success so im hoping some advanced users might have a solution.

I am trying create an accordion type of uitableviewcell that, when the user selects the cell, it expands to display a detailed view with a textfield and some other labels inline similar to how the digg app works. I initially tried replacing the current tablecell with a new customcell in cellForRowAtIndex by calling reloadRowsAtIndex which works fine, however the animation does not look the way i want as you can visually see the cell being reloaded either from the top, bottom, left, etc. depending on what animation style you choose.

If you look at the digg app and others who have done this it seems that they arent replacing the current cell but instead expanding the cell
Does anyone have any ideas how to accomplish a similar effect?

I did find out that by calling [tableView beginUpdates] and [tableView endUpdates] right after one another the table will reset its geometry and this animates the cell to its new row height using the exact animation effect i am looking for. The problem is that i am not sure where to put the code that adds the additional textfield, labels, etc to the expanded cell??? I cant put it in cellForRowAtIndex because while [tableView beginUpdates] and [tableView endUpdates] does redo the tables geometry it does NOT call cellForRowAtIndex.

Any ideas, this has been driving me crazy for the past few days and i really want to move on to something else.

Last edited by s.newave; 06-22-2010 at 07:15 PM.
s.newave is offline   Reply With Quote
Old 06-23-2010, 03:16 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 25
s.newave is on a distinguished road
Default

Bump.

Someone has to know how to do this?
s.newave is offline   Reply With Quote
Old 06-23-2010, 11:40 AM   #3 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

I would think you would just call cellForRowAtIndexPath: after beginUpdates, and make the changes directly to the UITableViewCell, or subclass if that's how you are doing it. The note in the documentation for reloadRowsAtIndexPaths:withRowAnimation: implies that it should work, although I've not tried it myself.
JasonR is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 369
9 members and 360 guests
.Snipe, AragornSG, baja_yu, ChrisYates, davejas69, guusleijsten, hussain1982, Kryckter, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:37 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0