android - ProgressBar and progressBarStyleHorizontal padding -


this question has answer here:

i have progress bar defined code:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="match_parent"     android:layout_height="match_parent">     <progressbar         xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"         android:layout_height="wrap_content"         style="?android:attr/progressbarstylehorizontal"         android:indeterminate="true"         android:paddingtop="0dp"         android:paddingbottom="0dp"         android:id="@+id/fragment_article_progressbar"         android:visibility="visible"         />          <webview             android:layout_width="match_parent"             android:layout_height="match_parent"             android:id="@+id/fragment_article_content"/>  </linearlayout> 

but when run it, padding added above , below progressbar

enter image description here

it doesn't seem natural.

is normal style of horizontal progressbar? if no, how can fix it?

cheers

try replace

 <progressbar         xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"         android:layout_height="wrap_content"         style="?android:attr/progressbarstylehorizontal"         android:indeterminate="true"         android:paddingtop="0dp"         android:paddingbottom="0dp"         android:id="@+id/fragment_article_progressbar"         android:visibility="visible"         /> 

via

 <progressbar         xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"         android:layout_height="wrap_content"         style="?android:attr/progressbarstylehorizontal"         android:indeterminate="true"         android:layout_marginbottom="-4dp"         android:layout_margintop="-4dp"         android:id="@+id/fragment_article_progressbar"         android:visibility="visible"         /> 

Comments