Search code examples
titaniumtitanium-mobile

List bullet size


How to increase the size of a list bullet? I am using ""\u2023 ABC" and applying style with font size :16. However the bullet size does not scale and only the font size scales.

"\u2023"= unicode for the bullet


Solution

  • Prasad, size of the bullet is also increasing with respect to the font size. But the probelm is the size of the bullet is small compared to the text. Please refer the screenshots I've taken in iPhone simulator with different font size

    smallest size 16 large medium with size 30 Largest with size 80

    The above in the above images, each of them has font sizes 16, 30 and 80 respectively. You can see that the arrow size is also increasing with respect to the font size.

    And here is a working solution for you.

    using 2 labels

    Here I've used two labels - one for the arrow and other for the city name having a font size 40 and 20 respectively, added them to the tableViewRow. You can change the font size as per your requirement

    Here is my code

    for(var i = 0 ; i < number_of_cities; i++ ){            
        var lblArrow = Ti.UI.createLabel({
            text    : "\u2023",
            font    : {fontSize : 40},
            left    : '3%'
        });
        var lblValue   = Ti.UI.createLabel({
            text    : cityList[i].name,
            font    : {fontSize : 20},
            left    : '10%'
        });
    
        tblData[i] = Ti.UI.createTableViewRow();
        tblData[i].add(lblArrow);
        tblData[i].add(lblValue);
    }
    

    Please note : I'm not sure that it's a best method, but it will resolve your issue