Re: [iPhone] UITableViewCell Height with UIWebView content
Re: [iPhone] UITableViewCell Height with UIWebView content
- Subject: Re: [iPhone] UITableViewCell Height with UIWebView content
- From: glenn andreas <email@hidden>
- Date: Tue, 10 Aug 2010 14:52:01 -0500
On Aug 10, 2010, at 2:04 PM, Sandro Noël wrote:
> Greetings.
>
> I've been trying to set the table view cell's height for a custom tableviewCell containing a UIWebView
> to display attributed content but i cant's get the height properly.
>
[snip]
> since it is so tedious, Now i'm thinking this is a design flaw on my part,
> trying to resize a TableCellView with posibily big content.
>
> any advice?
>
Rethink your design - putting a UIWebView inside a UITableView is usually a bad idea for a number of reasons, including:
- not being able to tell the height of the view until far too late to be any good (UITableView needs to know before it is displayed, UIWebView can't know until after everything has been loaded)
- views which scroll vertically inside other views which scroll vertically can cause a bad user experience (though at least as of 3.x they work - in previous OSes the results were far less useful),
- UIWebView is a very heavy weight view, and UITableViewCells are designed to be light weight
You should probably put the resulting UIWebView in its own view controller, and push that as a disclosure of the table cell (or detail disclosure).
If your goal is just to display "styled text" inside a table row, you can use things like NSAttributedString/CoreText (or for pre 3.2 support, CFAttributedString & custom drawing routines).
Glenn Andreas email@hidden
The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden