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

  • Home
  • SEARCH
  • 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 6671175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:21:24+00:00 2026-05-26T03:21:24+00:00

I have a weird problem in a custom UITableCell subClass.This custom cell has a

  • 0

I have a weird problem in a custom UITableCell subClass.This custom cell has a pair of UILables that are multi-line and can contain varying amounts of text (up to 2000 characters). The custom tableCell has a layout method where I am calculating their frame’s height using the code below, taking the device orientation into account:

if (isPortrait) {
    presentationTextLabelSize = [presentationTextStr sizeWithFont:[UIFont systemFontOfSize:12.0f] constrainedToSize:CGSizeMake(portraitDescriptionWidth, 2000.0f) lineBreakMode:UILineBreakModeWordWrap];
    presentationTextLabelRect = CGRectMake(60.0f, 25.0f, portraitDescriptionWidth, presentationTextLabelSize.height);
} else {
    presentationTextLabelSize = [presentationTextStr sizeWithFont:[UIFont systemFontOfSize:12.0f] constrainedToSize:CGSizeMake(landscapeDescriptionWidth, 2000.0f) lineBreakMode:UILineBreakModeWordWrap];
    presentationTextLabelRect = CGRectMake(60.0f, 25.0f, landscapeDescriptionWidth, presentationTextLabelSize.height);
}

self.presentationTextLabel.frame = presentationTextLabelRect;

I have the label’s autoResizeMask set as follows:

self.presentationTextLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;

I use the same calculation in the UITableViewController to set the row height.

Everything works perfectly, the label is sized to the correct height for it’s width, and the cell autoResizes on device rotation, except that when the device is rotated to landscape the label’s text sometimes extends out of the label’s frame to the right, clear past the edge of the tableView. If I scroll the cell out of view and back again it’s back to normal. I am logging the cell’s width to the console, and it is correct, yet the text extends far past that width.

Any ideas what’s joing on?

Thanks

  • 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-26T03:21:24+00:00Added an answer on May 26, 2026 at 3:21 am

    The problem is, the tableView is not reloaded when the device is rotated to landscape. So, there is mismatch in updating the texts. Use [tableView reloadData]; at the place, where you find the device is changed to landscape mode.

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

Sidebar

Related Questions

I have a weird problem that i can't figure out a solution for: I've
I have this weird problem.. I'm building an in-house app that should register all
I am facing this very weird problem, I have created a custom UITableViewCell on
I have this weird problem with setting up cookies with PHP. Everything worked fine
I have a weird problem, and I don't know if this is the default
Hey guys, I have a weird problem. I have an update system that refreshes
I have a very weird problem.. I really do hope someone has an answer
This one is weird. I have a list view that is a part of
I have a weird problem that sometimes when I make a change to a
This is a little bit of weird problem here. Say I have a C++

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.