nicolas zimerman
nicolas zimerman

Reputation: 45

Cant set small size to ProgressBar (android)

I can't set the size of my progressBar. I've tried this :

style="?android:attr/progressBarStyleSmall"

And this:

android:maxHeight="5dp"

The layout xml:

 <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <!-- The main content view -->
    <FrameLayout
        android:id="@+id/frame_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </FrameLayout>


       <ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:indeterminate="true"
        style="?android:attr/progressBarStyle"
        android:id="@+id/progress_bar"
        android:maxHeight="5dp"
        android:layout_marginRight="5dp" />

    <!-- The navigation drawer list 
        <LinearLayout
        android:id="@+id/linear_layout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="left"
        android:layout_marginTop="10dp">  
    "#368ee0" -->

    <ListView
        android:id="@+id/slider_list"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#368ee0"
        android:textColor="#ffffff"
        android:choiceMode="singleChoice"
        android:divider="#b0e0e6"
        android:dividerHeight="1dp" />
    <!--
    </LinearLayout>-->

</android.support.v4.widget.DrawerLayout>

I create the ProgressBar in the MainActivity and when i am updating the display (updateDisplay), I create a new WebFragment and I pass the progressBar as argument, the WebFragment then runs a thread that after finished turns the visibility of the progressBar to "gone".

Upvotes: 0

Views: 127

Answers (1)

pepe
pepe

Reputation: 11

Better late than never

Check this line in the ProgressBar

android:layout_height="match_parent"

maybe you want

android:layout_height="wrap_content"

Upvotes: 1

Related Questions