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 7894895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:30:37+00:00 2026-06-03T07:30:37+00:00

I have a UITableViewCell subclass with backgroundView set to my own UIView object. This

  • 0

I have a UITableViewCell subclass with backgroundView set to my own UIView object. This UIView object contains three CALayer layers. I implemented - (void)layoutSubviews where I update all my CALayer layers. The problem is autorotation.

When I rotate from landscape to portrait mode there’s this cosmetic issue:

During the animation, all my CALayer layers are as narrow as in portrait mode.

It seems that this guy is right:

When layoutSubviews gets called during an orientation change, the view’s bounds are already set to what they will be at the conclusion of the rotation.

Source: How to achieve smooth animation when using single-step rotation / How do I get the new frame size at the start of rotation?

So, where should I update my layers to achieve proper autorotation? The view is already rotating them, so I suppose there’s no need to do any custom animations, just adjust the size. Right?

  • 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-06-03T07:30:39+00:00Added an answer on June 3, 2026 at 7:30 am

    Figured it out:

    1. subclass CALayer + add sublayers into it
    2. implement resizing of sublayers in CALayer‘s - (void)layoutSublayers method
    3. subclass UIView + override + (Class)layerClass in it:

      + (Class)layerClass {
          return [SubclassedCALayer class];
      }
      
    4. set the subclassed UIView as backgroundView of UITableViewCell

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

Sidebar

Related Questions

I have a custom UITableViewCell subclass. I have set the contentView of my cell
Similar to this question I have a custom subclass of UITableViewCell that has a
I have a UITableViewCell subclass (set up in IB). When entering editing mode, the
I created a subclass of UITableViewCell and added two identical UIView s that have
I have subclass a UITableViewCell as follows: @class MyCell; @protocol MyCellDelegate - (void) viewController:(MyCell*)viewCon
I have a subclass of UITableViewCell which contains several elements - UIImageViews, Labels, etc.
I have implemented a subclass of UITableViewCell called UITableViewCellCustom . When entering in editing
So in a UITableViewCell subclass this works great: - (void)awakeFromNib { [super awakeFromNib]; UIImageView
I have a UISwitch inside a custom UITableViewCell (the subclass of which I call
I have a UITableViewCell that contains a UIScrollView . The UIScrollView contains a different

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.