Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7554589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:22:36+00:00 2026-05-30T11:22:36+00:00

After reading numerous posts on SO and other sites, I still cannot seem to

  • 0

After reading numerous posts on SO and other sites, I still cannot seem to get a custom cell working that expands and retracts while animating the size change.

Accordion table cell – How to dynamically expand/contract uitableviewcell?
is one of the posts that has the most promise, but I suspect it only works when using labels and not necessarily a background image. Many other sites also follow this same concept.

Here’s what I’ve done:

I’ve tried adding one large (expanded) image to a cell’s contentView, then adjusting it’s size in layoutSubviews, but the change is instant so there is no animation.

I’ve tried adding two images (collapsed & expanded) to the cell’s contentView, then setting them to hidden and visible as appropriate when setSelected:animated: is called, but the expanded cells can be clearly seen over the other cells when animating.

I’ve also tried setting the contentView of the cells clipTobounds to YES, but it doesn’t appear to do anything.

After spending nearly 3 days on this, I’m tempted to sublass UIScrollView and make my own table view, or maybe make 2 versions of each cell, but I’m hoping it won’t have to go that far.

Can anyone post a FULL example of a UITableViewCell subclass that can expand and collapse, with a background image, that animates and doesn’t overlap the other cells?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:22:37+00:00Added an answer on May 30, 2026 at 11:22 am

    Turns out using clipToBounds was the right way after all. Instead of doing it in the init method, it needs to be set in layoutSubviews.

    Then, dynamically change the cell’s view’s frames to match the height of the cell.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading some posts like this one: Choose File Dialog It appears that Android
After reading several other blog posts and articles (references found below) there appear to
After reading this tidbit , it would seem that the current user's permission would
After reading the Head First Design Patterns book and using a number of other
After reading a bit more about how Gnutella and other P2P networks function, I
After reading Evan's and Nilsson's books I am still not sure how to manage
After reading the Test-and-Set Wikipedia entry , I am still left with the question
After reading the documentation for MySQL Workbench I got the impression that it's possible
After reading the answer to this question , I learned that SFINAE can be
After reading a question on @private I understand how that works. However, since all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.