Android Question Hiding/Showing Views when needed

JoshyDEWstive

Member
Licensed User
Hi all,
How do i hide views and panels, i want to make like a menu but I dont know how
to hide the panel when its done being used. And a button that shows it.

Thanks
 

NJDude

Expert
Licensed User
Can you post some of your code?, for example, if I want to change the visibility of a panel I do:
B4X:
Private Panel1 As Panel

...

Panel1.Visible = FALSE
 

JoshyDEWstive

Member
Licensed User
Nope doesnt work: CODE:
B4X:
Sub Credits_Click
Private DevMenuOne As Panel
DevMenuOne.Visible = False
    Msgbox("Made by JoshyDEWstive","Credits")
    DevMenuOne.Visible = True
End Sub
Thanks
 

NJDude

Expert
Licensed User
Well my friend, I suggest you read the documentation first, what I posted was just a code snippet, you can find links to the documentation on my signature below.
 

LucaMs

Expert
Licensed User
Nope doesnt work: CODE:
B4X:
Sub Credits_Click
Private DevMenuOne As Panel
DevMenuOne.Visible = False
    Msgbox("Made by JoshyDEWstive","Credits")
    DevMenuOne.Visible = True
End Sub
Thanks

A panel (and any other view) must be added to an Activity or to a Panel, otherwise they are not created.

Then you could write:
B4X:
Private DevMenuOne As Panel
Activity.AddView(DevMenuOne, ...)
(I suggest pnlDevMenuOne so you can see immediatly that DevMenuOne is a Panel)

MsgBox needs no additional Panel.
 
Top