Android Question lock buttons in screen

Discussion in 'Android Questions' started by yaniv hanya, Jul 3, 2019.

  1. yaniv hanya

    yaniv hanya Active Member Licensed User

    I have a panel that looks like a popup but even when it covers the whole screen the buttons under it work. How do I lock the entire screen below it while it appears
     
  2. klaus

    klaus Expert Licensed User

    You need to add an event for that panel to 'consume' the events, like:
    Code:
    Sub Panel1_Click

    End Sub
     
  3. yaniv hanya

    yaniv hanya Active Member Licensed User

    How do I add it if I created the panel during run time?
     
  4. klaus

    klaus Expert Licensed User

    Why do you add it during run time?
    You can define it in the Designer and set its Visible property.
     
  5. yaniv hanya

    yaniv hanya Active Member Licensed User

    I could but I tried to do it that way. If it's hard I'll do it in the designer
    thenks
     
  6. klaus

    klaus Expert Licensed User

    How do you add the panel in the code?
     
  7. yaniv hanya

    yaniv hanya Active Member Licensed User

    Code:
    Private p As Panel
    Code:
    p.Initialize("")   
    p.LoadLayout(
    "SetWaterLevelLy")
    Activity.AddView(p,0,0,100%x,100%y)
     
  8. klaus

    klaus Expert Licensed User

    Like this:
    Code:
    p.Initialize("Panel1")   
    p.LoadLayout(
    "SetWaterLevelLy")
    Activity.AddView(p,0,0,100%x,100%y)
    And
    Code:
    Sub Panel1_Click

    End Sub
     
    emexes likes this.
  9. yaniv hanya

    yaniv hanya Active Member Licensed User

    Thanks, great
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    There is a small mistake here:
    Code:
    p.Initialize("Panel1")   
    p.LoadLayout(
    "SetWaterLevelLy")
    Activity.AddView(p,0,0,100%x,100%y)
    You should always set the container size before you load the layout. Otherwise features such as anchors and designer script will not work properly.

    Correct code:
    Code:
    p.Initialize("Panel1")   
    Activity.AddView(p,0,0,100%x,100%y)
    p.LoadLayout(
    "SetWaterLevelLy")
     
    Johan Hormaza and klaus 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