0

I am trying to add vertical progressbar in Android. I can add horizontal progressbar but I can't able to do it for vertical. I tried to change style="?android:attr/progressBarStyleHorizontal" to style="?android:attr/progressBarStyleVertical" and it gives error.

So how to add vertical progressbar in Android? It can't be hard, I suppose. However I couldn't solve it :)

HorizontalProgressBar works as expected

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ProgressBar
        android:id="@+id/progressBar1"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />

</RelativeLayout>

VerticalProgressBar gives error

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ProgressBar
        android:id="@+id/progressBar1"
        style="?android:attr/progressBarStyleVertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />

</RelativeLayout>

Note: I am trying to create vertical progressbar like this: https://i.stack.imgur.com/hyDxO.jpg

Note 2: I suppose Android DOES NOT SUPPORT vertical progressbar and it seems still does not support: https://stackoverflow.com/a/3926520/4606368

Community
  • 1
  • 1
Aykut Uludağ
  • 1,876
  • 5
  • 18
  • 34
  • post some code ... knowing what you have tried doesn't help if we don't know how you have tried. – apelsoczi Jul 13 '16 at 23:41
  • Actually there is no code. Just I added progressbar to empty xml and I tried to change its style style="?android:attr/progressBarStyleHorizontal" to style="?android:attr/progressBarStyleVertical" for creating vertical progressbar and it gives error. – Aykut Uludağ Jul 13 '16 at 23:45
  • I added some codes – Aykut Uludağ Jul 13 '16 at 23:55
  • I saw that question and answers just now thanks to you. Is that answer still valid? Date of answer is about 6 years old. If it is valid is there any easy way to add vertical progressbar like library? – Aykut Uludağ Jul 14 '16 at 00:00

0 Answers0