简体   繁体   中英

android pop up menu

I have followed this tutorial to create a seek bar on a transparent background. How can I make it pop up on the screen when pressing a button ?

You can add a button to your app and then use that to set the visibility of the seek bar from View.GONE to View.VISIBLE . Something like this:

final TransparentPanel transparentPanel = ... //however you initialize
transparentPanel.setVisibility(View.GONE); //make it invisible to start
button.setOnClickListener(new View.OnClickListener(){
    //Make the panel visible whenever someone clicks on your new button
    transparentPanel.setVisibility(View.VISIBLE);
});

//add the button to whatever ViewGroup transparentPanel lives in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM