How do I remove this unnecessary white space (refer screenshot) between the navigation bar and layout? In the android studio, there is no white space shown but when running the app this unwanted white space added automatically. I tested this on two real android devices and emulator and the results were the same.
layout XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false"
android:orientation="vertical"
android:visibility="visible"
android:weightSum="1"
tools:context="com.test.test.MainActivity">
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:visibility="visible" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:background="@color/blueui"
android:fillViewport="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/btn1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_background"
android:clickable="true"
android:focusable="true"
android:text="@string/btn1"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_background"
android:clickable="true"
android:focusable="true"
android:text="@string/btn2"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_background"
android:clickable="true"
android:focusable="true"
android:text="@string/btn3"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_background"
android:clickable="true"
android:focusable="true"
android:text="@string/btn4"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_background"
android:clickable="true"
android:focusable="true"
android:text="@string/btn5"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp" />
<Button
android:id="@+id/btn6"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_background"
android:clickable="true"
android:focusable="true"
android:text="@string/btn6"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="12sp" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
app theme
<resources>
<style name="AppTheme" 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>
</resources>