Android Question How to set views' Horizontal Anchor and Vertical Anchor properties by codes?

Hi, everyone

I am creating a layout by codes.
I found it is easily to set its' Left, Top, Width and Height. But how can I set it's Horizontal Anchor and Vertical Anchor by codes?

custom view:
    Dim mBase As Panel
    mBase.Initialize("mBase")
   
    Dim lblTitle as Label
    lblTitle.Initialize("lblTitle")
    lblTitle.TextSize = 14
    lblTitle.TextColor = Colors.Black
    lblTitle.Gravity = Bit.Or(Gravity.Left, Gravity.CENTER_HORIZONTAL)
    lblTitle.Text = "qty per pallet"
    mBase.AddView(lblTitle, 0, 0, 90dip, 20dip)

    Activity.AddView(mBase, 0, 0, 100%x, 100%y)

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…