I am trying to put an image as thumb for my custom seekbar. The problem is I don't know what should the size of the image for the thumb be. In my case it just goes outside of the seekabr (too big).
Check this, you will get idea about android's standard icon sizes
http://developer.android.com/design/style/iconography.html
Related
Recently, I've been working with seekbar. I want to create seekbar have a small gap between thumb and progress bar like in the picture I attached. Can anyone help me or tell me how I can do. Thanks
Seekbar sample
I think your thumb image have some spacing so this is happend.
I solved this problem by very simple, like Brahgrav said, just redraw the thumb with spaced outside and set to android:thumb. I will attach a thumb image for you to see.
Thumb image
I'm new to android programming and I was wondering about how to get a background image (ImageView) show a drawable with a correct size.
Let me explain well, let's imagine we have this image:
I want this image to get shown with this aspect ratio on all screens.
Since I don't want the image to get stretched, I would like to set manually how my image gets shown, maybe by modifying its scale with thirdy part software.
the problem with this image is that, in portrait mode, it's not guaranteed to see the ball, and so I want to crop the part of my image so that the ball gets shown on the bottom-right edge.
I know that I have to import my drawable for all resolutions, but simply importing does not help... Any suggestions?
EDIT:
I'm facing this problem with dynamic background ImageView, so I'm not going to user xml layout files.
Using scaleType attribute doesn't help for this, or at least not just by setting its value.
I am trying to make a seekbar with only nine-patch images. One nine patch is the background. I want to remove the thumb and want the other nine-patch to expand when I slide towards the right. Presently the thumb always appears.
I have tried the method given in this answer:
Android seekbar set custom style using nine-patch images
But this also gives an extra thumb. And on sliding right the nine patch appears complete only when I am done sliding till the extreme right. Here is my nine patch image and I want the arm to increase as I go towards the right on the seekbar.
Any help?
P.S. by thumb I mean the seekbar thumb and not the thumb in the image.
Need to make an image like this
Can anyone tell me how I can set the size (height, width) of the thumb in seekbar. I googled and found this to be done only through code. But I want this to set in xml only.
I have a work around for exactly what you need, you just need to use an image and place it in your xml at android:thumb="#drawable/seekbar_thumb_slider"
you can use this thumb as per your choice .
It doesn't exaclty answer your question but you can do it as a workaround, a thinner drawable would reduce the Thumb size ofcourse.
I have set negative paddings on my custom seekbar so that the round thumb image can go outside the bar, but the thumb isn't rendered out there, is there anyway to force the thumb to be drawn outside those bounds?
Sorry guys, I'm new to Android development, and have been tasked with fixing an existing application. The problem is that we have a custom rounded looking track bar, which consists of two rounded 'end cap' images and a 1 px background that is tiled to create the seekbar. As far as I can tell there was never one image that could be set as the background of a normal SeekBar, which is why a custom one was created.
The thumb is a circle and needs to 'fit' into the end caps - the three pieces of the bar are in a relative layout. Right now I'm kind of unclear as to how the 1 px background png gets stretched as the seekbar bg, otherwise I would try to tack on the two endcaps onto that drawable some how ... ?
Please let me know if this was unclear and I'll try to post any followup info. Thanks in advance for any advice!!
Oh, I'm using Android 2.1 if that's relevant to anyone's interests :)
This is what it looks like when the thumb all the way over - outside of the seekbar. Ideally what I need is for the thumb to be shown as 'inside' the endcap image :-/
I was having the same problem, my thumb is very big length wise and it kept being cut off. Make sure that you set the offset property AFTER you set the drawable for your thumb, like this:
seek.setThumb(Main.app.getResources().getDrawable(R.drawable.thumb));
seek.setThumbOffset(15);
This will set the correct offset when your thumb is very long.
Try to change the thumb offset property, after that it will not go off from the seek bar
I just ran into this issue. I was able to get satisfactory results by using android:paddingLeft and android:paddingRight within the XML.