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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:09:09+00:00 2026-05-22T18:09:09+00:00

This is my first time using Three20 and I am trying to add a

  • 0

This is my first time using Three20 and I am trying to add a TTStyledTextLabel to my TTTableViewCell using the following code:

@interface ConvoreCell : TTTableViewCell{
    TTStyledTextLabel * tt_title;
    UITextView * title;
    UILabel * detailed;
}

@property (nonatomic, retain) IBOutlet UITextView * title;
@property (nonatomic, retain) IBOutlet UILabel * detailed;
@property (nonatomic, retain) TTStyledTextLabel * tt_title;

@end



- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
    if (self == [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
        // Initialization code
        tt_title = [[TTStyledTextLabel alloc] init];
        tt_title.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:tt_title];
    }
    return self;
}


- (void)layoutSubviews {
    [super layoutSubviews];

    CGRect frame = tt_title.frame;
    frame.size.width = 640;
    frame.size.height = tt_title.text.height;
    frame.origin.x = 45;
    frame.origin.y = 5;
    tt_title.frame = frame;
}


and in my TTTableView I have:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CGFloat titleHeight = [TTStyledText textFromXHTML:[[self.posts objectAtIndex:indexPath.row] message] lineBreaks:YES URLs:YES].height;
    //NSLog(@"HEIGHT IS %f", titleHeight);
    return titleHeight + 20;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"ConvoreCell";

    ConvoreCell *cell = (ConvoreCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[ConvoreCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }

 TTImageView * avatar = [[TTImageView alloc] initWithFrame:CGRectMake(cell.frame.origin.x+5, cell.frame.origin.y+5, 40, 40)];
        avatar.urlPath = [[[self.posts objectAtIndex:indexPath.row] creator] img];
        avatar.userInteractionEnabled = YES;
        avatar.tag = indexPath.row;
        [cell addSubview:avatar];


 cell.tt_title.text = [TTStyledText textFromXHTML:[[self.posts objectAtIndex:indexPath.row] message] lineBreaks:YES URLs:YES];
}

However, the layout is messy as hell. Why is this?
enter image description here

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

    I cannot find anything wrong with your code.

    Looking at the image, what strikes me is that the last row which is correcly displayed contains a link.

    What I suspect is that it could be some bug in TTStyledText, which in my experience is not really suitable for displaying full HTML.

    Could you try and confirm (or dismiss) this hypothesis? Is always so that a url in a row will make it “go crazy”?

    In any case, it will help to set a breakpoint on (or an NSLog after) the line

     cell.tt_title.text = [TTStyledText textFromXHTML:[[self.posts objectAtIndex:indexPath.row] message] lineBreaks:YES URLs:YES];
    

    and check what is going in cell.tt_title.text.

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

Sidebar

Related Questions

This is my first time using joomla. I don't know if I'm using the
This is my first time using Magento. I upgraded this site from 1.4.1.1 to
This is my first time using splint (from Ubuntu repositories) and I immediately got
This is my first time using SQL, and I thought I did everything right,
This is my first time attempting to call an ASP.NET page method from jQuery.
This is my first time with Web services. I have to develop web services
This is a really basic question but this is the first time I've used
Been a while since I've dealt with ASP.NET and this is the first time
I have recently started learning F#, and this is the first time I've ever
I'm fairly new to deploying desktop applications, so this is the first time I'm

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.