AppCompat의 전체 화면 테마 추락했습니다. 내

활동에 전체 화면 테마 (제목 표시 줄 + 작업 표시 줄 없음)를 적용하는 방법을 알고 싶습니다. 지원 패키지 v7의 AppCompat 라이브러리를 사용하고 있습니다.

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"특정 활동 에 적용하려고 했지만 추락했습니다. 내 응용 프로그램 테마가 이와 같기 때문이라고 생각합니다.

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

나는 또한 이것을 시도했다

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

제목 표시 줄 만 숨기고 작업 표시 줄은 숨 깁니다. 내 현재 해결 방법은 작업 표시 줄을 숨기는 것입니다.

getSupportActionBar().hide();



답변

응용 프로그램에서 Theme.AppCompat를 사용하면 스타일에 아래 코드를 추가하여 FullScreenTheme을 사용할 수 있습니다.

<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

매니페스트 파일에 언급하십시오.

<activity
   android:name=".activities.FullViewActivity"
   android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
/>


답변

@nebyan의 답변을 바탕으로 작업 표시 줄이 여전히 숨어 있지 않다는 것을 알았습니다.

다음 코드는 저에게 효과적입니다.

<style name="AppFullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

물론 AndroidManifest파일 편집을 잊어 버리지 않았습니다 .

<activity
    android:name="YOUR_ACTIVITY_NAME"
    android:theme="@style/AppFullScreenTheme"
/>


답변

<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
</style>

style.xml에서 위의 xml을 사용하면 제목과 작업 표시 줄을 숨길 수 있습니다.


답변

Android 4.0 (API 레벨 14) 버전 전후에 문제가 발생합니다.

여기 에서
내 자신의 솔루션을 만들었습니다.

@SuppressLint("NewApi")
@Override
protected void onResume()
{
    super.onResume();

    if (Build.VERSION.SDK_INT < 16)
    {
        // Hide the status bar
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Hide the action bar
        getSupportActionBar().hide();
    }
    else
    {
        // Hide the status bar
        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
        / Hide the action bar
        getActionBar().hide();
    }
}

앱에서 나가서 다시 열면 작업 표시 줄이 계속 활성화되어 있기 때문에 onResume () 메서드 에이 코드를 작성합니다! (그래서 문제가 해결됩니다)

도움이 되었기를 바랍니다.)


답변

“해결 방법”(actionBar를 숨기고)이 일반적인 방법입니다. 그러나 Google은 TitleBar가 숨겨져있을 때 항상 ActionBar를 숨기도록 명령합니다. 여기를보십시오 : https://developer.android.com/training/system-ui/status.html


답변

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //to remove "information bar" above the action bar
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    //to remove the action bar (title bar)
    getSupportActionBar().hide();
}


답변

아래 단계를 수행 할 수 있습니다 :-

AndoridMenifest.xml

<activity
            android:name=".ui.FullImageActivity"
            android:label="@string/title_activity_main"
            android:screenOrientation="landscape"
            android:theme="@style/DialogTheme">
        </activity>

Style.xml

<style name="DialogTheme" parent="android:Theme.Dialog">

    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>

   <!-- No backgrounds, titles or window float -->
    <item name="android:windowNoTitle">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowIsFloating">false</item>
</style>

FullImageActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    setContentView(R.layout.image_view);
     }

도움이 되길 바랍니다. 감사합니다 !!