> On Mon, 21 Mar 2011 20:58:40 +1100, BareFeetWare 
> <list.develo...@barefeetware.com> said:
>> 

>> I'm trying to show text in a UIWebView to match exactly how it appears in a 
>> UITextView. Is there a standard library or subclass to do this?
>> 

On 22/03/2011, at 2:59 PM, Matt Neuburg wrote:
> 
> This might not be possible, as they may use two completely different engines 
> for drawing. m.

Thanks for your reply.

Well, the odd thing is that UITextView and UIWebView seem to very closely mimic 
each other. Neither of them match the layout resulting from using CoreText. I 
wrote some CoreText code to layout my text, some time back, and it uses very 
different spacing. WebKit and UITextView seem identical, down to the pixel, in 
layout, with only a few small exceptions, like the ones I mentioned earlier.

I have my own class and methods for converting text to HTML (including 
converting < to &lt; etc), but I thought since this must be a common 
requirement, that there is some more robust class out there.

My particular need arises because of multicoloured text. My method actually 
takes an NSAttributedString and converts all the color changes into CSS/HTML 
etc.

Anyone out there converting text to HTML with the same layout as UITextView?

Thanks,
Tom
BareFeetWare
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to