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
    Code:
    For i=0 To cursor1.RowCount -1
            cursor1.Position=i
            food_code= cursor1.GetString(
    "PRODUCT_CODE")
            food_name = cursor1.GetString(
    "PRODUCT_NAME")
            food_price = cursor1.GetDouble(
    "PRODUCT_PRICE")
            lvFood.AddTwoLines2(
    $"${food_code} ${food_name}"$$"RM $1.2{NumberFormat2(food_price,1,2,2,False)}"$, food_code)
        
    Next
        cursor1.Close
       
        lvFood.TwoLinesLayout.Label.TextColor = 
    Colors.Black
        lvFood.TwoLinesLayout.SecondLabel.Gravity = 
    Gravity.RIGHT
    This is the result I get
    [​IMG]

    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).
     
Loading...
  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