1

Check this image for the progressbar

Any idea how to remove that little gap under the ProgressBar? How can I achieve no gap? Should it be via java code in the MainActivity or...? Here is my Layout xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.v7.widget.Toolbar
    android:id="@+id/my_toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:elevation="4dp"
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

<ProgressBar
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="wrap_content"
    android:layout_height="2.9dp"
    android:id="@+id/progressBar"
    android:background="@android:color/transparent"
    android:layout_alignParentStart="true"
    android:layout_alignParentEnd="true"
    android:layout_alignBottom="@id/my_toolbar"/>

<WebView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/webView"
    android:layout_alignParentEnd="true"
    android:layout_alignParentStart="true"
    android:layout_below="@+id/my_toolbar"
    android:layout_alignParentBottom="true" />

</RelativeLayout>
Async
  • 245
  • 1
  • 4
  • 14

1 Answers1

2

Add just negative margin to the Progressbar

Updated Code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.v7.widget.Toolbar
    android:id="@+id/my_toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:elevation="4dp"
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

<ProgressBar
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="wrap_content"
    android:layout_height="2.9dp"
    android:id="@+id/progressBar"
    android:background="@android:color/transparent"
    android:layout_alignParentStart="true"
    android:layout_alignParentEnd="true"
    android:layout_alignBottom="@id/my_toolbar"
    android:layout_marginBottom="-2dip"
/>

<WebView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/webView"
    android:layout_alignParentEnd="true"
    android:layout_alignParentStart="true"
    android:layout_below="@+id/my_toolbar"
    android:layout_alignParentBottom="true" />

</RelativeLayout>
Maheshwar Ligade
  • 6,709
  • 4
  • 42
  • 59