0

I have a problem with the BULLET character in my Android App developed with Titanium.

I have this part of code:

    function getFormattedPizza()
{
    var text = win.crust + ' pizza with:\n';
    if (win.toppings.length == 0)
    {
        text += '• Plain (cheese pizza)\n';
    }
    else
    {
        for (var i = 0; i < win.toppings.length; i++)
        {
            text += '&bull; ' + win.toppings[i] + '\n';
        }
    }
    return text;
}

and in my app I see the string &bull ; Plain (cheese pizza), not an unordered list.

In that way I can show a dots list?

sharkbait
  • 2,980
  • 16
  • 51
  • 89

1 Answers1

2

instead of &bull you can use the '\u2022'+'Plain (cheese pizza)', \u2022 is the unicode for bullet.

Samlple code :

var lbl = Ti.UI.createLabel({
    text : '\u2022'+' HELLO'
});
win.add(lbl);

For more unicodes you can check this Link, or refer to this question.

Hope this will help you. :)

Community
  • 1
  • 1
Swanand
  • 1,138
  • 8
  • 21
  • 1
    @sharkbait, `•` is an HTML escape for “•”. Otherwise, e.g. in a JavaScript string, it is just six Ascii characters (though such a string can be processed so that it will be parsed as HTML, but that’s a different thing). In JavaScript, use the `\u02022` escape or the character “•” (if the character encoding of the file containing it has been properly declared, as it should be anyway). – Jukka K. Korpela Oct 10 '14 at 10:19