Is it possible to add some sort of styling to my localizable.strings file.
For example
"HELLO_WORLD" = "Hello \bold WORLD \bold";
No, it is not possible. Localized strings can be used in many places in your code and UI, only some of which may support display of rich text. For example, a UILabel has a text property that you can set from a localized string but it has no capability of showing rich text.
You will need to choose some way of displaying rich text in your UI then decide how you are going to encode that text in a localized string. You may end up having to parse the localized string and do custom text drawing depending on where and how you want to display the text.
Related
I have a list that I want to display some text as bold and other parts not bold. First of all I have been accomplishing this when not inside of a list by just making a bunch of labels and then manually going through the text adding \n and spaces for formatting, which takes forever. If there is an easier way of doing that I would love to know. Anyway my question is how can I add formatted text to a list.
So instead of those individual text elements I want to add multiple formatted text elements in place of one.
how can I add formatted text to a list
sorry, that's unfortunately not possible with App Inventor
you can take a look at this App Inventor Classic example, which uses some HTML to do the formatting
I am building an iPad app that needs to display certain RichText parapraphs
Title1 (bold and big font)
Description1 (rich text may contain images)
Title2 (bold and big font)
Description2 (rich text may contain images)
Title3 (bold and big font)
Description3 (rich text may contain images)
and so on.....
What is the best way to display this information in a ViewController?
I have looked at UIWebView and from the looks of it, it needs either a URL or a HTML String that it can load. Whereas, in my scenario, I have multiple HTML strings that need to go in different places on the screen.
Any ideas what is the best way to deal with this? Can I instead use a UITextView?
Thanks in advance.
Has anyone tried to change the font formatting(bold/italic/color) of a selected word or sentence in a UITextView, like a text editor application? I have been trying to do this but it seems formatting is applied only to the whole text, not on individual words or sentences.
you can change any specific word font, style and size also,
Make UITextView text to "Attributed", by default it was "Plain"
and then you can perform edition on selected text.
UITextView cannot style text fragments. Styles, colors and fonts are applied to the entire text. You may wish to use a UIWebView or Core Text to render your text instead.
I have about twenty UITextViews and corresponding .txt files. What I want is to make each UITextView take the contents of the corresponding file and display it.
Moreover, the text is formatted and it contains some formulas (copy/pasted from Grapher). I've heard about displaying formatted text in UIWebView, but I haven't found a clear explanation anywhere.
Thanks in advance!
Text files normally don't contain formatted text.
If by "formatted" you mean "html" then yes, you will want to use UIWebView. Basically you will convert the text to an HTML document, and then use the web view to display that document. There are several example projects available from Apple that show you how to use UIWebView.
Displaying formula in a UITextView will be difficult as the character rules for formula are completely different from language text. You could generate HTML to display it that but that is difficult as well.
I think your best bet would be to draw the formula to an image and then display the image. That is the traditional way to handle the display of formula.
im having problems with formatting for a UITextView. my app pulls in XML, saves some of it to a string , and then displays the text in a UITextView.
it understands if you put a return in there, and it starts a new line. but i want to put paragraphs in there, any idea how i can pass that information without doing multiple UITextViews
Thanks :)
If you are converting to text from XML content, then it is probably easier to use a UIWebView and format using html.
If you want total control of formatting, then you need to move to using Core Text (3.2/iPad).