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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:37:58+00:00 2026-05-14T09:37:58+00:00

I made a UITableViewCell subclass, and now I want that subclass to be clever.

  • 0

I made a UITableViewCell subclass, and now I want that subclass to be “clever”. It should align it’s contents to the height of the row. But for this, the cell must know what height value was provided for it in this method:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

However, no matter what value I assign here, my cell’s frame is 44 px height at initialization time (default style). Is there any way I can get that value from the cell at initialization time?

  • 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-14T09:37:59+00:00Added an answer on May 14, 2026 at 9:37 am

    I assume that you load data in a background process
    bacause there is no data at the beginning, it won’t call you heightForRowAtIndexPath so it is using the default cell style with 44px and white background.

    if you really want to make it looks the same as it has data. you can put some dummy data(empty string) then your heightForRowAtIndexPath will be called.

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

Sidebar

Related Questions

I have a nib file for a UITableViewCell subclass I made, it's height is
I made a typo when creating a UITableViewCell with this code: - (UITableViewCell *)tableView:(UITableView
I made a custom UITableViewCell in IB, but for some reason, despite the single
I have a UITableViewController with two IBOutlet's to two different UITableViewCell's that were made
I made a class that derives from Component: public class MyComponent: System.ComponentModel.Component { }
I made a code that translate strings to match each word from the array
I made a UIView using Interface Builder with a top bar that has Cancel
I'm reading a custom table cell in tableView:cellForRowAtIndexPath: from a nib file. This works
I have a UITableview made up with a custom cell loaded from a nib.
I have a UITableView populated with a bunch of music players that I've made

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.