Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 隐藏和显示操作栏元素消失_Java_Android_Android Studio_Android Actionbar_Hide - Fatal编程技术网

Java 隐藏和显示操作栏元素消失

Java 隐藏和显示操作栏元素消失,java,android,android-studio,android-actionbar,hide,Java,Android,Android Studio,Android Actionbar,Hide,我需要在一个精确的时刻隐藏ActionBar隐藏ActionBar并将应用程序置于全屏,因此隐藏元素视图,如文本视图。问题是,当我回到正常模式时,textview在ActionBar后面 有人知道我该怎么解决这个问题吗 int uiOptions; mView = this.getWindow().getDecorView(); TextView text = (TextView) findViewById(R.id.textName); if (enabled

我需要在一个精确的时刻隐藏ActionBar隐藏ActionBar并将应用程序置于全屏,因此隐藏元素视图,如文本视图。问题是,当我回到正常模式时,textview在ActionBar后面

有人知道我该怎么解决这个问题吗

    int uiOptions;
    mView = this.getWindow().getDecorView();
    TextView text = (TextView) findViewById(R.id.textName);

    if (enabled) {
        text.setVisibility(View.INVISIBLE);
        uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        mView.setSystemUiVisibility(uiOptions);
        getSupportActionBar().hide();
        customHandler.postDelayed(updateTimerThread, 1000);

    } else {
        text.setVisibility(View.VISIBLE);
        uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        mView.setSystemUiVisibility(uiOptions);
        getSupportActionBar().show();
        customHandler.removeCallbacks(updateTimerThread);
        if (mMenu != null) {
            mMenu.setTitle(R.string.menu_start);
        }
        mView.setBackgroundColor(Color.WHITE);
    }

只需在ActionBar可见并工作后将元素保持可见

只需在ActionBar可见并工作后将元素保持可见!