我已按照此tutorial在透明背景上创建搜索栏。按下按钮时如何让它弹出屏幕?
答案 0 :(得分:1)
您可以向应用添加按钮,然后使用该按钮将搜索栏的可见性设置为View.GONE
到View.VISIBLE
。像这样:
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