Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Seek Bar Increase Height

I am working with a SeekBar that works perfectly fine. But I want to increase the height of the Progress bar, as the native height is not as high.

So how can I change the height of the progress bar, either dynamically or through XML?

like image 862
Usman Kurd Avatar asked May 13 '13 07:05

Usman Kurd


People also ask

How to increase SeekBar height in Android?

None of the above works, simply set android:layout_height="10dp" to whatever value you want!

How do you increase the size of the progress bar?

You try set Grid width=100 or bigger. And the ProgressRing should set HorizontalAlignment and verticalAlignment to Stretch and not any width,height and margin.

How do I change SeekBar thickness?

You can use the Slider provided by the Material Components Library. Use the app:trackHeight="xxdp" (the default value is 4dp ) to change the height of the track bar. It requires the version 1.2. 0 of the library.

What is SeekBar?

A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged. Clients of the SeekBar can attach a SeekBar.


1 Answers

You have to add some padding for all directions and also set the min and max height of the SeekBar.

Here is one example that I used:

    <?xml version="1.0" encoding="utf-8"?>
    <SeekBar xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:progressDrawable="@drawable/custom_player_seekbar_background"
            android:paddingTop="10dp" 
            android:paddingBottom="10dp" 
            android:thumb="@drawable/bt_do_player" 
            android:paddingLeft="30dp" 
            android:paddingRight="30dp" 
            android:minHeight="6dp"
            android:maxHeight="6dp" 
            android:layout_centerVertical="true"/>
like image 136
Jatin Patel Avatar answered Oct 21 '22 19:10

Jatin Patel