钛应用程序中的 Unicode 字符'BULLET'



我用Titanium开发的Android应用程序中的BULLET字符有问题。

我有这部分代码:

    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;
}

在我的应用程序中,我看到字符串&公牛普通(奶酪披萨),而不是无序列表。

这样我就可以显示点列表了?

您可以使用'u2022'+'Plain (cheese pizza)'而不是&bullu2022是子弹头的unicode。

Samlple代码:

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

有关更多unicode,您可以查看此链接,或参阅此问题。

希望这对你有所帮助。:)

最新更新