Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6775565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:55:18+00:00 2026-05-26T15:55:18+00:00

I have customised my SeekBar – I use a custom image as the background,

  • 0

I have customised my SeekBar – I use a custom image as the background, and a custom image as the thumb (How to create custom layout for seekbar in android? & How to customize the look of a SeekBar in Android?).

The idea is to make a SeekBar that looks like the ones in this image:

enter image description here

I wish to have the thumb image fit perfectly into the rounded bar when the progress value is set at 0 or 100 (out of 100).

In order to position the thumb correctly (i.e. not overlap the ends of the bar) I have set the paddingLeft & paddingRight values to exactly half the width of the thumb width (Android: Seekbar doesn't scroll all the way to end).

…/res/layout/main.xml:

<SeekBar android:id="@+id/frequency_slider"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:max="100" android:progress="0"
    android:progressDrawable="@drawable/seekbar_no_visible_progress"
    android:thumb="@drawable/seekbar_thumb" <!-- this is an image -->
    android:background="@drawable/hos_bar" <!-- this is an image -->
    android:paddingLeft="24dp"
    android:paddingRight="24dp">
</SeekBar>

This works in Android 2.1.


In Android 2.2 this produces a different effect:

enter image description here


After further investigation (and trying this with a totally default SeekBar I have found that the position of the thumb image has changed from 2.1 to 2.2. My hack of changing the paddingLeft & paddingRight is not the issue.

  • In 2.1, the thumb is centred around the end of the bar, with half the thumb on the bar, and half of it off the bar.
  • In 2.2, the thumb is positioned within the bar, without any overlap. Hence the strange way the padding values effect the outcome. This is what I was trying to achieve, but when using a custom thumb, this effect no longer works the same way.

I think I need to make a custom java class to handle this type of thing. In this question (Possible to do rounded corners in custom Progressbar progressDrawable?), the developer uses a ClipDrawable in order to make a normal progress bar.

What type of drawable object would I use, and how, in order to correctly position my thumb?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:55:18+00:00Added an answer on May 26, 2026 at 3:55 pm

    The behaviour of thumbOffset parameter has changed between these 2 versions. ThumbOffset determines the actual offset of the thumb image, compared to the position parameter provided.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I try to customize a seekbar. Here's my Problem: main.xml ... <SeekBar android:id=@+id/seekBar1
I have a Swing application that is heavy customised with a lot of custom
I have an MVC2 application and use ReSharper 6.1 - I've heavily customised the
I want to have a SeekBar with a thumb that appears as the user
I am configuring Jira for bug reporting, I have customised the create/edit/view screens for
I have a barbuttonitem which i have customised using a custom button with an
I like a dark background when coding and have customised it to a scheme
We have an application which we licence to separate companies. The app is customised
I have a lot of customized javascript and layout design, and I want to
I have to develop a customized tab control and decided to create it with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.