工具栏顶部的空白区域。Android,Java
我只是在我的应用程序中加入了一个选项菜单,但在我的一个活动中,它似乎创建了一个空白-有人能告诉我为什么吗?? 它适用于同一应用程序中的其他活动,但不适用于此单个活动。 我希望任何人都能帮忙:-)工具栏顶部的空白区域。Android,Java,java,android,toolbar,Java,Android,Toolbar,我只是在我的应用程序中加入了一个选项菜单,但在我的一个活动中,它似乎创建了一个空白-有人能告诉我为什么吗?? 它适用于同一应用程序中的其他活动,但不适用于此单个活动。 我希望任何人都能帮忙:-) 活动图片 从布局中删除android:gravity=“center\u vertical”。然后,您的布局将如下所示: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout x
活动图片
从布局中删除
android:gravity=“center\u vertical”
。然后,您的布局将如下所示:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/include"
layout="@layout/toolbar_layout"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
<ImageView
android:layout_below="@id/include"
android:id="@+id/iv_gif"
android:layout_width="match_parent"
android:layout_height="220dp" />
</RelativeLayout>
从布局中删除
android:gravity=“center\u vertical”
。然后,您的布局将如下所示:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/include"
layout="@layout/toolbar_layout"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
<ImageView
android:layout_below="@id/include"
android:id="@+id/iv_gif"
android:layout_width="match_parent"
android:layout_height="220dp" />
</RelativeLayout>
非常感谢!:-)我很乐意帮助你:)。请向上投票并接受作为对他人有帮助的答案。我找不到你?还没有,请为答案做点什么谢谢!:-)我很乐意帮助你:)。请向上投票并接受作为一个答案,这将有助于其他人。我不能得到你?还没有,请为答案做
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/include"
layout="@layout/toolbar_layout"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
<ImageView
android:layout_below="@id/include"
android:id="@+id/iv_gif"
android:layout_width="match_parent"
android:layout_height="220dp" />
</RelativeLayout>