Android Question [sloved]why BringToFront and SendToBack no effect

Discussion in 'Android Questions' started by Maodge, Jul 12, 2019.

  1. Maodge

    Maodge Member Licensed User

    Hello Alls,
    In project, I try to a imageview and a label on a button. code like this
    Code:
    Button1...properties set
        Button1.SendToBack

        ImageView1...properties set
        ImageView1.BringToFront

        Label1...properties set
        Label1.BringToFront
    test on android 4.X ,it display ok.
    but on android 8.0 (huawei), it does not display img and label text.
    So why button BringToFront and SendToBack no effect ?

    and thanks

    I test using a label replay button like. And project on android 8.0 (huawei),
    img and text display ok.

    Code:
    Button1...properties set
        Button1.SendToBack

    'use label replace button
        Button1.Visible =False
        
    Dim lbl As Label
        lbl.Initialize(
    "lbl")
        
    Activity.AddView(lbl,Button1.Left,Button1.Top,Button1.Width,Button1.Height)
        
    Dim cd2 As ColorDrawable
        cd2.Initialize2(
    Colors.DarkGray,8dip,2dip,Colors.White)
        lbl.Background = cd2
        lbl.SendToBack

        ImageView1...properties set
        ImageView1.BringToFront

        Label1...properties set
        Label1.BringToFront
     

    Attached Files:

    Last edited: Jul 12, 2019
  2. Brandsum

    Brandsum Active Member Licensed User

    Use CSBuilder to add image inside a button
     
    Maodge likes this.
  3. DonManfred

    DonManfred Expert Licensed User

    Put the label and img in a panel and set its elevation.
     

    Attached Files:

    • new.zip
      File size:
      12 KB
      Views:
      9
    BillMeyer and Maodge like this.
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