Android Question Hiding/Showing Views when needed

JoshyDEWstive

Member
Licensed User
Longtime 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
 

JoshyDEWstive

Member
Licensed User
Longtime 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
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime 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.
 
Upvote 0
Top