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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:49:58+00:00 2026-05-11T18:49:58+00:00

How do i change the location of the text AND show the FULL string

  • 0

How do i change the location of the text AND show the FULL string in UITableView?

Here is a screen shot of what I have, once you look at it you will know what I mean. Thanks
My App http://img188.imageshack.us/img188/9926/chucknhelp.tif

  • 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-11T18:49:58+00:00Added an answer on May 11, 2026 at 6:49 pm

    You can do it without subclassing UITableViewCell.

    In the method tableView:cellForRowAtIndexPath:, create a basic UITableViewCell and change the properties of the UILabel contained in this cell. Change the maximum number of lines to fit more text in your cell.

    Unfortunately, the label of the cell is not accessible by properties, so you need to fetch it with the subviews property.

    Of course this uses an implementation detail of UITableViewCell, so it might break with future releases of the SDK. Use with care.

    Here is an example:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"YourCellId"];
        if (cell == nil)
        {
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"YourCellId"] autorelease];
            cell.font = [UIFont systemFontOfSize:16];
            UILabel* cellLabel = [cell.contentView.subviews objectAtIndex:0];
            [cellLabel setNumberOfLines:3];
        }
        cell.text = @"Your text";
        return cell;
    }
    

    Update:

    To set the row height to fit the text, you can do the following:

    1. Set the cell height to fit the text.

    You need something like this:

    CGSize textSize = [text sizeWithFont:font
                       constrainedToSize:CGSizeMake(313, 1000)
                           lineBreakMode:UILineBreakModeWordWrap];
    cell.frame = CGRectMake(0.0f, 0.0f, 320.0, textSize.height);
    

    2. Return the cell height in the tableView:heightForRowAtIndexPath: method.

    For example like this:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
        UITableViewCell* cell = [self tableView:(UITableView*)self.view cellForRowAtIndexPath:indexPath];
        CGRect cellFrame = cell.frame;
        return cellFrame.size.height;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following JavaScript for show running line: <script type=text/javascript language=javascript> //Change script's
I am working on map kit and i have task to change location in
Does anyone know how to change the location of the svn tool used in
Is there a way to change location of IsolatedStorage files? I am using .NET
I am using moodle and I change location of my web site, but I
I want to change the location of web.xml file of a tomcat web application.
I would like to change the database files location of MySQL administrator to another
Attempting to change the files folder location in a Drupal site from /files to
I have a report which is grouped by location and charge_type with detail information.
<string name=no_city><font color='#FF0000'><b>Please select your location under Preferences in the menu</b></font> </string> @Override public

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.