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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:25:33+00:00 2026-06-12T21:25:33+00:00

I have a design where UITableViewCell s contains an UIImageView . This image should

  • 0

I have a design where UITableViewCells contains an UIImageView. This image should have the same proportion in portrait or landscape, this is why I have a method called when interface orientation changes using UIDeviceOrientationDidChangeNotification notification.

-(void)updateRowHeightForOrientation:(UIInterfaceOrientation)orientation {

    if(!IS_KNOWN_ORIENTATION(orientation))
        return;

    CGFloat rowHeightPortrait = (IPAD ? 320. : 160.);
    CGFloat widthPortrait = (IPAD ? 768. : 320.);
    CGFloat orientationWidth = (IS_PORTRAIT(orientation) ?
                                (IPAD ? 768. : 320.) :
                                (IPAD ? 1024. : 480.));

    CGFloat resultingRowHeight = rowHeightPortrait * orientationWidth / widthPortrait;

    [self.tableView setRowHeight:resultingRowHeight];
//    [self.tableView reloadData]; /* works if uncommented */
}

If the line is not commented the view is redrawn and the row height is set properly. If not, even when using [self.tableView setNeedsDisplay] or [self.tableView setNeedsLayout] the new value of the property is not used.

How can I force reloading the UI so the new value is applied ?

It worked for some time using -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration because the rowHeight property is set before the interface rotates and is redrawn, but for some strange reasons this method is not called anymore…

Thanks for your help !

  • 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-12T21:25:36+00:00Added an answer on June 12, 2026 at 9:25 pm

    I think that

    [self.tableView beginUpdates];
    [self.tableView endUpdates];
    

    causes the table view to re-evaluate all row heights, so you could try this.

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

Sidebar

Related Questions

I have a design question... I want to create my own image class called
I have this design which I cannot seem to get right, I would like
I have a UITableView of custom UITableViewCells which looks like this: [ CELL 0
I have this design how can I add this effect ?? can give an
I have table design like this: id_a int(10) NO PRI id_b int(10) NO PRI
I have to design a simply animation which should play next X frames with
I have design report using iReport . In this report I have one custom
I have a design issue. I would like to write a method accepts either
i have design similar to below given link. when i open this link and
I have written a class for UITableViewCell called TaskCell and designed a .xib file

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.