首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在android全屏模式下使用所有空间

在android全屏模式下使用所有空间
EN

Stack Overflow用户
提问于 2018-06-04 04:15:08
回答 2查看 180关注 0票数 0

在android studio中,当我设置全屏模式时,我仍然无法使用屏幕上的所有空间(例如导航栏的空间)。

我该怎么办?

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".Game">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/start_game"
    android:textColor="@color/white" />

第4行和第5行的match parent不考虑全屏模式。

这就是我让它全屏显示的方法:

        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION);
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50670586

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档