Android Question Not sure what I'm doing wrong with Visual Designer

edm68

Member
Licensed User
Longtime User
Hi,
I wanted to add a couple of panels to a scrollview. The first panel would have all the buttons, spinners, edittexts, etc. The second panel would only be visible when an edittext has focus. It would be like a custom keypad. For testing though I just have it as visible.
I'm also trying to learn about the all variants script in the designer. I'm not very good at explaining, so I've attached a couple of screenshots from designer and attached a sample project. When I add one line to the all variants script it makes the button go way off the screen. I don't understand why?
Thanks in advance for any advice.
 

Attachments

  • scriptWKPTest.zip
    9.2 KB · Views: 156
  • btnKP1.PNG
    btnKP1.PNG
    37.3 KB · Views: 225
  • btnKP2.PNG
    btnKP2.PNG
    38.2 KB · Views: 203

Cableguy

Expert
Licensed User
Longtime User
You can't add views directly into the scrollview in the designer.
You need to create your inner panel layout separately and add it at runtime to the scrollview's inner panel using sv.innerPanel.loadlayout(....)
 
Upvote 0

edm68

Member
Licensed User
Longtime User
Thanks for the answer. Now I'm more confused, I thought that's what I was already doing with:
B4X:
    Activity.LoadLayout("Main")
    svMain.Panel.LoadLayout("KP")
    svMain.Panel.Height=pnlSV.Height
"Main" contains the scrollview. "KP" contains 2 panels, pnlSV & pnlKP.

Thanks for any help.
 
Upvote 0
Top