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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:00:21+00:00 2026-05-20T12:00:21+00:00

Can someone summarise the key pieces of objective-c code that would assist in solving

  • 0

Can someone summarise the key pieces of objective-c code that would assist in solving this.

Objective – Autoresize a UITableView after a user changes the font size. Therefore if the user increases or descreases font both the (a) uiLabel heights should change to ensure they nicely include text, and (b) uiTableViewCell heights should also adjust.

Assumption is that:

  1. UITableView has been extended via
    creation of a custom cell view –
    i.e. create a new view in a NIB that
    forms for the content view of the
    UITableView cells
  2. each custom
    cell has four UILabel’s which form a
    2 x 2 patter of UILabels – i.e. two
    on top line and two on bottom line
  3. so as the user increases the font
    the horizontal spacing of the
    UILabels would remain the same,
    however the label heights would
    change

So I assume the challenge / questions I have would include (and hopefully be answered by some sample code that someone can post)

  1. Is it OK that the starting point here is an already laid out custom UITableViewCell in InterfaceBuilder? (or does the solution require it is constructed totally programmatically)?
  2. How to calculate the heights the label’s should be? Is this just with the NSString method “sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:”, and do I need to add addition for margins etc?
  3. How programmatically to increase the height of the labels dynamically – in which method do you do this & how to change the height itself
  4. How to ensure that when UILabel at the top is expanded & grows, that it automatically pushes down the UILabel on the 2nd row? Does this happen by default or is there a specific property/setting you have to you to ensure this hapens.
  5. How to then automatically increase the height of the TableViewcell, after the above has occurred. Which method to do this in, and how programmatically to perform the increase & redraw.

Hope this makes sense.
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-20T12:00:22+00:00Added an answer on May 20, 2026 at 12:00 pm
    1. You can base on the XIB file as a default layout, then adjust the position/size later during runtime.
    2. Yes use that method to calculate the required height. You need to add margins between labels yourself.
    3. Change the label’s frame.
    4. You need to calculate the x,y of the 2nd row’s label base on the x,y,height from the 1st row’s label + margin.
    5. hook with the following method and return the new height:
      • (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can someone explain why the compiler accepts only this code template<typename L, size_t offset,
Can someone tell me why this code produces error? The C# code DateTime now
Can someone please summarise what this regular expression will do? ValidationExpression=^[a-zA-Z0-9'.\s\-&\(\)]*$ Is there any
Can someone point me to an article that shows the dropdownlist being populated from
Can someone tell me why this processes all the files and then does it
Can someone give me an example of how I would delete a row in
Can someone explain to me this odd thing: When in python shell I type
Can someone show me how to include this javascript file into my wordpress plugin.
Can someone tell me why this is not working: <button class=btn danger id=delete onclick=return
can someone help me re-write this SQL for MySQL database (has both subquery and

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.