TTTableSubtextItem text overflow when using UITableViewStyleGrouped

39 views
Skip to first unread message

Nic Hubbard

unread,
Feb 1, 2011, 2:34:09 PM2/1/11
to Three20
I am using a TTTableSubtextItem and I am constantly getting text
overflowing out of my table cell. This only happens when I am using
UITableViewStyleGrouped (which I do want to use), but not when I use
UITableViewStylePlain.

Is there some bug in the rowHeightForObject method that does not
account for using a Grouped TableView?

See: http://www.puc.edu/__data/assets/image/0011/78806/Screen-shot-2011-02-01-at-11.33.00-AM.png

Mike Morearty

unread,
Feb 2, 2011, 10:21:50 PM2/2/11
to thr...@googlegroups.com
You're right, looks like they calculated the cell height wrong.  I've submitted a patch.

Nic Hubbard

unread,
Feb 2, 2011, 11:16:05 PM2/2/11
to Three20
Thank you!

On Feb 2, 7:21 pm, Mike Morearty <m...@morearty.com> wrote:
> You're right, looks like they calculated the cell height wrong.  I've
> submitted a patch <https://github.com/facebook/three20/pull/381>.

Philip Walton

unread,
Feb 24, 2011, 5:44:49 PM2/24/11
to thr...@googlegroups.com
The patch that Mike submitted is not quite correct. It ignores the fact
that a TTTableSubtextItem can have a URL property, thus an
accessoryView, which will take away 20 more pixels from the width.

This is what I've done to deal with that.

CGFloat accessoryViewWidth = item.URL ? 20.0 : 0.0;
CGFloat width = tableView.width - [tableView tableCellMargin]*2 -
kTableCellHPadding*2 - accessoryViewWidth;

Mike, unless I'm missing something, you might want to add this to your
patch.

Mike Morearty

unread,
Feb 24, 2011, 6:34:08 PM2/24/11
to thr...@googlegroups.com
Very good point, Philip -- but the same appears to be true of almost all of the item types that can have a URL (which is to say, almost all the subclasses of TTTableLinkedItem).  TTStyledTextTableItemCell seems to be the only cell type that tries to adjust for this.

So rather than fix just the one case of TTTableSubtextItem by modifying this patch, I've logged a separate bug for the URL issue.  https://github.com/facebook/three20/issues/429

Philip Walton

unread,
Feb 24, 2011, 7:15:45 PM2/24/11
to thr...@googlegroups.com
Thanks Mike, I suspected that was probably the case.

> --
> You received this message because you are subscribed to the Google
> Groups "Three20" group.
> To post to this group, send email to thr...@googlegroups.com
> To unsubscribe from this group, send email to
> three20+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/three20?hl=en
>
> To learn more about Three20, check out
> http://Three20.info/

Reply all
Reply to author
Forward
0 new messages