Android Question Listview Text2 alignment problem

Discussion in 'Android Questions' started by Ho Chia Leung, Apr 1, 2015.

  1. Ho Chia Leung

    Ho Chia Leung Member Licensed User

    Hi all,

    I'm utilizing the Text2 of Listview control. Here is my code
    For i=0 To cursor1.RowCount -1
            food_code= cursor1.GetString(
            food_name = cursor1.GetString(
            food_price = cursor1.GetDouble(
    $"${food_code} ${food_name}"$$"RM $1.2{NumberFormat2(food_price,1,2,2,False)}"$, food_code)
        lvFood.TwoLinesLayout.Label.TextColor = 
        lvFood.TwoLinesLayout.SecondLabel.Gravity = 
    This is the result I get

    Half of my last character is missing when I set gravity to right. How to fix this?

    Thank you!
  2. Erel

    Erel Administrator Staff Member Licensed User

    You need to set the label and second label properties before you add items.

    You can also change the label left property (though it is not clear from this screenshot whether it is required or not here).
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice