2016-03-08 103 views
1

Check this image for the progressbarProgressBar gap

任何想法如何消除ProgressBar下的那個小間隙? 我該如何實現無差距?它應該通過MainActivity中的java代碼還是...? 這是我的佈局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> 
+0

給予負填充,以進度 –

+0

你的意思是一點點保證金先生? – Chunrand

+0

yes marginBottom = -10dp like wise –

回答

2

添加只是負緣至Progressbar

更新的代碼

<?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>