Android 应用程序栏上方的空白区域
我如何消除下面显示的空白(水平红线之间的空间)?直到我买了一部新手机(三星S8),我才在我的应用程序上看到这一点,它比我的旧HTC手机有更多的垂直屏幕空间 该活动的布局文件的开头是:Android 应用程序栏上方的空白区域,android,android-layout,screen,Android,Android Layout,Screen,我如何消除下面显示的空白(水平红线之间的空间)?直到我买了一部新手机(三星S8),我才在我的应用程序上看到这一点,它比我的旧HTC手机有更多的垂直屏幕空间 该活动的布局文件的开头是: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout ...
我试着用谷歌搜索这个问题,但什么也找不到——我一定是在搜索错误的术语。我需要编辑什么文件才能消除应用程序操作栏上方的空白
编辑:为了进行比较,以下是该应用程序在emulator中的外观(它在我的HTC One上的外观相同):
当我在三星S8上运行该应用程序时,我希望该应用程序的行为与上面相同(即操作栏上方没有黑色空间)。我需要更改什么?更改此
希望这能帮到你,如果没有的话,请发布完整的xml文件
很高兴为您提供帮助这是因为三星Galaxy S8的宽高比更大。默认情况下,Android应用程序支持16:9的最大纵横比。要解决此问题,请将此元素添加到
操作栏中,不是吗?我认为Theme需要更改为NoActionBar
,以便与工具栏一起使用。谢谢,我会尝试一下,然后返回报告。使用Theme.AppCompat.Light.NoActionBar
不起作用:它只是导致动作栏(下方红线下方显示“概率谜题”的栏)消失。我希望动作栏上方(两条红线之间)的空白区域消失。您需要查看哪个xml文件?请发布此布局的整个xml文件
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<meta-data android:name="android.max_aspect" android:value="2.1" />