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 09-15-2011, 08:19 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 285
mickm is on a distinguished road
Default grouped style UITableView animation issue

i have a grouped style tableview where each group exists in an expanded or collapsed state. in the collapsed state, the first cell is kind of a header cell, and is 71 pixels in height. the 2nd cell is only 21 pixels in height, and is used to simulate the look of something of a container. so it really is having the cell separator there that gives an indication that there is more than one cell there.

when the user taps on the first cell, all the cells that belong in the expanded state are animated in with the following code:

Code:
 if (rowsToAnimate)
    {
        [tableView beginUpdates];
        {
           if (insertRows)
            {
                [tableView insertRowsAtIndexPaths:rowsToAnimate withRowAnimation:UITableViewRowAnimationMiddle];
            }
            else
            {
                [tableView deleteRowsAtIndexPaths:rowsToAnimate withRowAnimation:UITableViewRowAnimationMiddle];
            }
        }
        [tableView endUpdates];
    }
all very straight forward, and works as you would expect.

the problem is this: the background color of the cells does not match the background view of the tableview, and so when animating you see the outline of the 2nd to last cell as the section is collapsing to just the 2 cells, or expanding to more than the two cells.

it looks like what is happening is the animated cells, which are always in between the first and last cell, are either drawn or removed first, and then the shift is made to move the last cell away from the first or up to it.

it is much more pronounced when there is only one cell in between the two.

if the last cell is the same height of the first cell, there is no issue. i found that the last cell has to be around 39 pixels in height to cover the result of the animation, but then that completely takes away from the look that the designers are after.

i am going to try always deleting that last cell and re-adding it on every animation, but that will take a little change in the code.

was wondering if anyone has any ideas, or if my explanation is clear?
mickm 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: 372
8 members and 364 guests
bignoggins, epaga, hussain1982, jcdevelopments, LunarMoon, omagod, pinacate, skog
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,643
Threads: 94,110
Posts: 402,860
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Diligent
Powered by vBadvanced CMPS v3.1.0

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