我正在实现一个应用程序,它总是在全屏上运行,没有标题栏。在这种情况下,用户单击按钮并使用语音识别特性API。一个android本机窗口被调用来分析用户的声音。但是,标题栏再次可见。问题是我不能再次隐藏它,因为隐藏它的方法只在onCreate方法中工作。
这里是我调用语音API的方法,标题栏再次可见。
public void VoiceCaptureButtonClick(View v) {
//- The title bar is properly hidden at this point.
//Code for calling the voice recogn
我用过
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
要在我的应用程序中隐藏标题栏.........这工作得很好,但是现在,在相同的活动和布局中,我需要在按下按钮时激活它。我可以这样做吗?我已经尝试过了,但返回了一个异常原因:
E/AndroidRuntime(23656): Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
我该如何解决这个问题呢?
this.ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized;
//this.visible = false (Hotkeys stop working forever but the grey rest of the form would disappear from above taskbar)
ReRegisterHotkeys();
我使用上面的代码来最小化我的应用程序的托盘图标。现在,最小化的表单其余部分仍然挂在左侧角落,略高于任务栏上的start按钮所在。可见仅为窗体灰色标题栏与小"x“关闭