Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个媒体播放器,我只想在播放歌曲时显示搜索栏,当歌曲没有播放或暂停时,我想隐藏搜索栏,请帮助实现这一点。我正在 htc 野火上开发 android 应用程序,其中运行着 android froyo 2.2。
使用类似的东西:
if(mediaPlayer.isPlaying() == false) { seekBar.setVisibility(View.GONE); }
setVisibility(View.GONE);
调用搜索栏应该可以解决问题。随后,要使其在其他操作调用期间重新出现:
setVisibility(View.VISIBLE);
希望这可以帮助。