Re: UIWebView HTML to match UITextView
Re: UIWebView HTML to match UITextView
- Subject: Re: UIWebView HTML to match UITextView
- From: BareFeetWare <email@hidden>
- Date: Tue, 22 Mar 2011 15:46:21 +1100
> On Mon, 21 Mar 2011 20:58:40 +1100, BareFeetWare <email@hidden> 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 < 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 (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