0

I was wondering how do applications store and display attributed text. By attributed text I mean text that can have photos, colors, style(bold italic etc) and so on.

is there a universal way through which one can store attributed text and display it everywhere (ios/android/web/desktop etc) ?

the only way I found after a lot of research was to store your text in HTML format and then using some kind of webview to render the html back. But is there another way to do this ?

an example of such app: the notes app on mac os

K.A.Q
  • 469
  • 4
  • 13
  • 1
    What are you trying to do? Why doesn't the WebView approach not work for you? – Tharkius Jul 01 '17 at 13:33
  • it works fine if you just want to display data but it gets more complicated when you want to implement it in text fields in IOS and Android or basically anything other than web – K.A.Q Jul 03 '17 at 16:07
  • If you need to display html text on TextView, check this link: https://stackoverflow.com/questions/2116162/how-to-display-html-in-textview#answer-2116191 – Tharkius Jul 03 '17 at 19:05
  • sorry, I used textview as a broad term here. what I meant is any textfield or anything where you can input text into – K.A.Q Jul 06 '17 at 06:49
  • You can't just have styled text in ANY kind of text input. What are you trying to achieve exactly? You could use html or rtf, but ofc it only works if the app you're using is actually programmed to parse it. – Tharkius Jul 06 '17 at 18:45
  • that is exactly my point, how do i edit html text inside an application ? in the system i am building all html text will be edited in a website using an html editor (tinyMCE) and displayed on mobile devices using webviews but I was just thinking it would be convenient if i can have html editing capabilities in the app as well – K.A.Q Jul 07 '17 at 08:15
  • 1
    Oh, now we're getting somewhere. You should give this library a try for that: https://github.com/wasabeef/richeditor-android – Tharkius Jul 07 '17 at 19:18
  • Thanks a lot! that is exactly what I needed and i also found an IOS one here https://github.com/cjwirth/RichEditorView. Thanks again ! – K.A.Q Jul 09 '17 at 13:35
  • No problem, glad to be of help ;) – Tharkius Jul 09 '17 at 21:33

0 Answers0