Plist strings to UILabel: formatting specific words in the text?

Developers,
I have a UILable populated by a plist string. I would like the UILabel to display text, with specific words in bold format.
I have looked around for a solution to this problem, but I haven't found anything useful on the net.
Is this possible?
I have been thinking that this could be done by using a key (e.g. stars around a word *word1*) that identifies particular words within the plist string to be formatted. An if statement could then be used to filter through which words should be formatted, within each string. I'm not sure if this would work or how i would implement it, which is why i turn to you for your experience and advice.
j
Message was edited by: james_coleman01

Hey James!
james_coleman01 wrote:
I would like the UILabel to display text, with specific words in bold format.
Any single instance of UILabel can only have one font, one text color, etc. There's no way to draw one letter or word differently from any other.
I have been thinking that this could be done by using a key (e.g. stars around a word *word1*) that identifies particular words within the plist string to be formatted. ...
As always, you're on the right track, James. In fact if you extend your idea to include syntax for italics, underlines, superscripts, etc., then add font family, point size and text color, then add various paragraph styles, you'll be well on your way to inventing what's known as "rich text".
So the web search keys you needed were "UILabel UITextView rich text". I think the two most common solutions to your requirement are: (1) If the text is static, put the words in separate labels; (2) The recommended, and most general solution: Use UIWebView in place of UILabel.
No. 2 isn't as kinky as it might seem, even if you've never used HTML (the most widely known example of rich text). Here's a short blog that's probably enough to get you going: [Display Rich Text Using a UIWebView|http://iphoneincubator.com/blog/windows-views/display-rich-text-using -a-uiwebview]. The responses on that page include some good tips too.
\- Ray

Similar Messages

  • How do I search for a specific word in the code using Dreamweaver?

    I need to search for a specific word in the code for all of my website pages. How can I do that using Dreamweaver?

    To search local files of a Defined Site in DW...
    Open the Find & Replace tool with Ctrl + F
    Change the Find In dropdown to Entire Current Local Site
    Change the Search dropdown to Text or Source code
    Add the text to find in the Find field
    Add the text to replace in the Replace field (or nothing if you just want to delete the text)
    Hit Replace All

  • To get  a  word in the text  file

    Hi,
    I m beginner to java.
    HOw i get a word in the text file.
    I used this code, it is only display the all sentence which are available in the text file.
    But , I need to print particular word (if it is available in that text file)
    package com.beryl;
    import java.io.*;
    class FileReadTest {
    public static void main (String[] args) {
         FileReadTest f = new FileReadTest();
    f.readMyFile();
    void readMyFile() {
         BufferedReader dis =null;
    String record = null;
    int recCount = 0;
    try {
    File f = new File("E:/hello/abc.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis
    = new BufferedReader(new InputStreamReader(bis));
    while ( (record=dis.readLine()) != null ) {
    recCount++;
    System.out.println(recCount + ": " + record);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
         try {
    dis.close();
         } catch (IOException ioe) {
    Thanks & Regards,
    kumar

    I used this code, it is only display the all
    sentence which are available in the text file.
    But , I need to print particular word (if it
    is available in that text file)if
    String.indexOf()

  • Today i purchased exportpdf. when converting from pdf to word doc, the text does not show up on word doc. what to do?

    when exporting pdf into a word doc the text does not show up on new doc. what to do?

    Hi hamsa142,
    Is this problem specific to one file, or does it happen with any file that you convert to PDF? How was the PDF created (using what application)?
    For starters you may want to disable OCR as described in this document: How to disable Optical Character Recognition (O... | Adobe Community.
    Please let us know how it goes.
    Best,
    Sara

  • How to set to bold a single word in the text box?

    How can I set to bold a single word in the text box? When I try, it puts the whole text bold.

    you should do this by HTML way
    like this :
    sym.$("your text box Name").html("Hello i'm <strong>Bold</strong> one")
    Zaxist

  • TS1135 how can you correct just a few words on the text in the flap of a iPhoto book? do you have to rewrite it all?

    How can you correct just a few words in the text on the flap of iphoto book?

    Select it and change it - exactly like you edit any text on yoru Mac
    LN

  • How to highlight specific words in the Reader

    Hi!
    I am new to the Acrobat SDK and could need some guidance on how to solve the following problem:
    I need a plug-in that is able to highlight specific words in a pdf file (e.g. by underlining it or changing the background color) and offers a context menu with futher actions when the user clicks on a highlighted word. The first step would be searching the text to find the word that should be marked. I think that should not be that hard but how can I highlight specific words? I first thought of annotations but I need it in the Reader and I should not change the pdf file itself (just the view of it).
    The idea is similar to the skype plug-in for Firefox or IE. The skype plug-in highlights phone numbers. We need to highlight specific words.
    Thanks for every hint on how to achieve this!
    Fabian

    >The documentation says that AVPageViewHilightText is supposed to use >the current color set with AVPageViewSetColor - so it should work. >What version of Acrobat are you working with?
    Yes that how understood the documentation too. I tried the following:
    //Define red
    red.space = PDDeviceRGB;
    red.value[0] = ASInt32ToFixed(1);
    red.value[1] = 0;
    red.value[2] = 0;
    // highlight
    AVPageViewSetColor(pageView, &red);
    PDTextSelect pdTextSelect = PDDocCreateTextSelect(pdDoc, pageNum, &bbox);
    AVPageViewHighlightText(pageView, pdTextSelect);
    I am using Acrobat 7.0.9.
    >Drawing an image would be done with AVPageViewDrawCosObj
    >- which means you'll need to bring the image in as a PDF
    > object and then render it.
    Oh I should have seen that. Thanks for the hint!!
    >Interesting, there should be a way to get transparency,
    > but I am not seeing it at the moment.
    As far as I understood it, it is possible to set the color to transparent but thats not what I am looking for. I would like to have a way of changing the alpha channel of the color.
    Thanks!
    Fabian

  • Add xml tag to specific words in a text frame

    Dear all,
    I'm pretty sure this can't be too much of a hassle, but after hours of experimenting, searching and reading I can't seem to look at it from the right angle. I'm trying to find a way to search for a specific word ('Figure', in my case) in a given text frame, and add a corresponding XML tag to it automatically. I've found plenty of information on how to apply it to a page item as a whole, but from there no approach seems to work. Seeing as I'm fairly new to InDesign scripting, any nudge in the right direction would be an immense help.
    Kind regards and thanks in advance,
    Julian

    Hi Julian,
    Is this you asking?
    var doc = app.activeDocument;
    app.findTextPreferences.findWhat = "figure";
    var found = doc.findText();
    for(var i =0;i<found.length;i++)
            doc.xmlElements[0].xmlElements.add({markupTag:"figure", xmlContent:found[i]});
    Regards,
    Chinna

  • Psd file format specification how get the pixel values

    Hello
    I'm trying to convert psd to xml and get all information from layers
    I already got all necessary  info  but for example  the radius  in rounded rectangle is in math double format but I need to have it in pixels.
    I'm using Adope photoshop file format specification but  there is no information how to convert double values to pixels,
    The same is with colors that also given in double.
    I need to know how to convert these values to actual values
    Thanks

    Hi,
    You can't do that. You have to format the numbers before you print them. Take a look at the decimal format class:
    http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html
    /Kaj

  • Can I have pages automatically replace specific words with the same word in a different font as I type?

    In MS Word I was able to set it up so any time I typed the name of the organization I run, Camp Aldersgate, it would automatically change the font to our branded font from our logo.  The font appears in the font list, and I can select it and use it.  How do I do the same thing in Pages?

    You can create a character style with the specific font. Custom styles are only document specific so save a documnet as a tempalte containing this style. Use this template when you need this style.
    When you have written you document use Find and replace > Advanced > write the word to find and write it again in the replace field but change the Style button option to the new specific style > press replace

  • How can I filter messages that do NOT contain a specific word in the subject?

    I want to do the opposite of what filtering normally does. I want to filter out messages that do not contain a word or a string.
    For example, I want to display emails that do not contain the word "meeting" in the subject.
    Is this possible? If so, how can it be done?

    It's not built in. The TotalQuickFilter extension allows NOT and lots of other filter features:
    https://addons.mozilla.org/en-US/thunderbird/addon/totalquickfilter/

  • Need to find a specific word in a Text Field

    I have a text field and I need to be able to perform a function if that field contains (not equals) the word "Excel". Textfield contains the word Excel
    My sample is below
    if (this.rawValue== "Excel") <---- instead of = I want something using wildcards before and after the word "Excel"
         Then do something
    Else
         Do something else

    Hi,
    you can use a regular expression for this task.
    if (this.rawValue.match(/\s+Excel\s+/g)) {
    } else {

  • PowerShell, email report with specific word in the body and email status.

    Hello,
    I've two doubt:
    1) I need to create a Powershell script that return a report if a "keyword or string" is present in the body/message. Can I do it? I've tried to find something but probably I can't.
    2) Can Powershell return the status of email (READ/NOT READ)? Example: a query return all mail sent by me, i would like see if receiver has read or unread the email.
    I've Exchange 2010 SP2.
    Thank you.

    Below are the links of few informative articles. These can help to resolve the issue.    
    http://tinyurl.com/lonryjy (You can monitor the complete system report including (body/message) even on daily basis.) 
    http://tinyurl.com/mlwgq6p (This link comes with an option to provide the static report of your sent email either the receiver has read your mail or still pending.)
    In addition, you can also use automated exchange reporting tools like
    this in case you are not able to do this with script.

  • Hi, We have a problem opening email attachments, specifically word, when the mail is sent from an Entourage client.

    It seems the mail is sent in plain text and when I try to open the attachment on my phone i just get a screen with the document name and type. If I send a plain text mail from my outlook client with the same attachment then this works fine.
    Is there anything I can do to make these attachments open on my iPhone?
    Thanks in advance
    Phil

    What about a work-around?
    Ios 7.1 etc. has a problem with communicating with exchange.  There are lots of reports of problems with pdf files.
    The work-arounds mentioned here may be of assistnace.
    https://discussions.apple.com/thread/5992793?start=0&tstart=0
    get a gmail account.
    There are lots of ways of moving files.
    A simple and popular way to copy files and share files among your devices.
    https://www.dropbox.com/
    "Box lets you store all of your content online, so you can access, manage and share it from anywhere. Integrate Box with Google Apps and Salesforce and access Box on mobile devices" Rated the most secure cloud storage by SkyHigh Networks.
    https://www.box.com/
    Files Connect -- "Cloud Storage services like Dropbox, MobileMe iDisk, Google Docs/Picasa, Facebook photos, FTP, SFTP, WebDAV ... AFS (Apple File Shares) SMB (Windows shares)  protocols"
    https://itunes.apple.com/us/app/files-connect/id404324302?mt=8
    Windows File server
    http://itunes.apple.com/us/app/filebrowser-access-files-on/id364738545?mt=8
    "Dukto is a simple application that allows you to share files between devices connected to the same (wireless) LAN network."
    http://www.tidal.it/?page_id=309&lang=en
    http://www.msec.it/blog/?page_id=11

  • Writing Records in a Text File to Specific Columns in the Text File

    Help Please! I am a noooooooooobbbbbb!
    I have searched this forum looking for a procedure that will write records from my database into certain col (positions) in a text file. Example:
    1234 TONY TEST 84889922 Y 34 TORCHCOMP 34
    5678 BOB JOHNS 43534534 N 56 SAFDWEERE 65
    I am thinking I would like to setup variaables like:
    Consumer_ID = Consumer(position 1,5)
    Name = name(position 10,20)
    Invoice_No = Invoice(position 30,40)
    etc.
    Any input will be greatly appreciated
    Thank You

    Hi,
    That's a formatting issue.
    Formatting is best done in the front end. For example, using SQL*Plus:
    COLUMN     consumer_id     FORMAT 9999     HEADING     c_id
    COLUMN     filler_6_9     FORMAT A4     HEADING     " "
    COLUMN     name          FORMAT A11
    COLUMN     filler_21_29     FORMAT A9     HEADING     " "
    COLUMN     invoice_no     FORMAT 9999999999
    SET     COLSEP          ""
    SET     PAGESIZE     9999
    SPOOL     x.dat
    SELECT     consumer_id
    ,     ' '          AS filler_6_9
    ,     name
    ,     ' '          AS filler_21_29
    ,     invoice_no
    FROM     table_x;
    SPOOL     OFFIf you have to do it in the back end, use functions like TO_CHAR and RPAD to make each part exactly the right length, then concatenate them all into one big string:
    SET     PAGESIZE     0
    SPOOL     x.dat
    SELECT     TO_CHAR ( consumer_id
              , 'fm99999'
              )          -- 1-5
    ||     '    '               -- 6-9
    ||     RPAD ( name
              , 11
              )               -- 10-20
    ||     '         '          -- 21-29
    ||     TO_CHAR ( invoice_no
              , 'fm9999999999'
              )          -- 30-40
    FROM     table_x;
    SPOOL     OFFEdited by: Frank Kulash on May 22, 2009 10:40 AM

Maybe you are looking for

  • PO status when PI has failed

    Hello, We are implementing SRM7 with ECS and we use PI to send XML PO to vendor systems. We would like the PO status to be updated when there is an error in PI like "error in Process". How can we implement that? Thanks

  • Cannot create PDF via Postscript

    I am trying to create a postscript file from Photoshop CS3 via the Adobe PDF 8.0 Printer. The file needs to fit on tabloid size paper to accommodate the crop marks. I choose the PDF printer, create postscript file, distill it and open it in Pro 8.1.2

  • Help with Costs in Subcontracting

    For the subon process, the finished product is ordered and the components are supplied.  Normally, the final cost of the finished product is the PO price + cost of the component.  However if I incurred a cost for transferring the component to the ven

  • Resetting default settings in ps cc 2014

    I need to reset my photoshop.  It is not functioning very well.  When I follow all the instructions, I don't get a pop up box to reset my settings.  Instead I get a whole window about getting started etc.  Nothing about resetting the program.  Ctl, A

  • InDesign CS3/Snow Leopard long print delay. Solved yet?

    I have Adobe CS3 Design Premium running on Snow Leopard 10.6.8 (on a Mac Mini dual core Intel w/ plenty of RAM) and while using In Design I am experiencing delays of 38-45 seconds when I use the print command (w/ spinning beach ball), even with simpl