How to simulate an image with extended text?

I want to simulate this kind of extended text: (From Twitter for iPad) alt text Only text with a button on a link .;) How can I put a button in a link? or make the link as cool as that?

I would like to have this view, but I should be able to select the text even when the view is not in edit mode (this is not possible in the Twitter application), but editing it is not necessarily a fantasy. A simple UITextView should be enough.

Any ideas how I can achieve this, or is there a library that I can use?

I do not want to use UIWebView, since I want to have at least 9 of these views and maybe UIWebView is slow?

thanks

EDIT

In earlier versions (iOS2.x), an undocumented API appeared in UITextView:

[myTextView setContentToHTMLString:@"<body><strong><p>Content In HTML</p></strong><p>Other Paragraph</p></body>"]; 

which still works in iOS4.2! (simulator test). But probably my application will be rejected; (

I also found this article that supports the theory that UITextView still supports HTML, but the API is not publicly available: http://www.lazyrobot.org.uk/2010/06/rich-text-on-iphone. html # comment-form

+4
source share
4 answers

Try LRLinkableLabel. https://github.com/lukeredpath/LRLinkableLabel It supports link formatting, but no more rich formats. Has he tried with CoreText yet?

+1
source

Perhaps you can do this using UIWebView and custom CSS.

0
source

This is similar to this question: UITextView or UIWebView with ordinary link-like words

Here is the answer I gave:

Have you reviewed the three20 library ? In one of my TTCatalog there are examples of displaying exactly what you are looking for. What's good about the project is that you can use HTML for styling - it will know to convert the anchor, for example, to a button click.

0
source

Take a look at this open source project: https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML

This allows you to generate NSAttributedStrings from HTML, and DTAttributedTextCintentView has a delegation method to place the button for the link.

0
source

Source: https://habr.com/ru/post/1334156/


All Articles