uislider

UISlider with certain possible values

时光怂恿深爱的人放手 提交于 2019-12-09 22:03:15
问题 I am willing to do this widget: Just A-B-C can be chosen. Any idea if someone already did something similar? If not, how would you do it? 回答1: Personally I'd use a standard UISlider and add logic to the valueChanged handler, so that once the user has dragged the slider to an arbitrary point on the scale, the code determines which is the nearest 'valid' value, and would manually set the value to a valid number. E.g. if the user drags the slider to 0.9, the distances to valid points are 0.9 (to

Change the size of a UISlider thumbImage

拟墨画扇 提交于 2019-12-09 19:33:11
问题 How can I change the size of a UIImage that I am using as a thumbImage. The code I use to set the image is as follows. let image: UIImage = UIImage(assetIdentifier: UIImage.AssetIdentifier.Slider) I use an Enum to get the image, no problem there. The code I use to set the thumbImage is as follows. self.setThumbImage(image, forState: UIControlState.Normal) I have tried using the code below to change the thumb images size but cannot find the solution. let trackRect: CGRect = CGRect(x: 0.0, y: 0

iOS - custom image for UISlider

别说谁变了你拦得住时间么 提交于 2019-12-09 16:41:19
问题 I want to use an image for the UISlider track. I don't want one color on the left of the thumb, and another color on the right. I just want one static image across the whole track. Possible? 回答1: For setting the image to your slider you can use the setMinimumTrackImage , setMaximumTrackImage methods. For your requirement set both to same image. iOS 5 and Below UIImage *sliderTrackImage = [[UIImage imageNamed: @"Slider.png"] stretchableImageWithLeftCapWidth: 7 topCapHeight: 0]; [mySlider

JQuery UI Slider - Combined Max for multiple sliders that also have individual max values

邮差的信 提交于 2019-12-09 00:50:11
问题 - Solved - I Know they exist, but I haven't found a slider that can easily meet some very basic needs and I'm sure I'm not the only one frustrated with this problem. This is what I have so far. Am I heading in the right direction? What I'm Trying to Do: Using the JQuery UI slider, I need multiple sliders on the page. Each slider will have a min of 0, a dynamic max, and a dynamic default value. I set these values in an input field with the html elements min, max, value and retrieve them later

Custom UISlider like the Music app

為{幸葍}努か 提交于 2019-12-08 18:24:17
问题 I've built a custom slider to show the progress of a music track playing and to allow scrubbing within the track. Both function fine, but there is a slight lag (and jumpy movement) once dragging has stopped and the slider is repositioned - The Apple Music app slider is seamless. _scrubberSlider = [[ScrubberSlider alloc] initWithFrame:CGRectMake(0, 0, 300, 30)]; _scrubberSlider.continuous = YES; _scrubberSlider.maximumValue = 1.0f; _scrubberSlider.minimumValue = 0.0f; [_scrubberSlider

UISlider increments

為{幸葍}努か 提交于 2019-12-08 18:17:28
I have a UISlider that slides with a range from 0.0 to 1.0. Out of the box, the slider lets users slide with a really high number of fraction digits, but I only want my users to be able to increment/decrement by .001 for each "tick" up or down of the slider. Is this possible to set up? Thank you! How big is this slider? Even if you've got it spanning the full width of the screen in landscape mode, a change of 0.001 is only about half a pixel. It sounds like you just need to round the slider's value (behind the scenes) to the precision you're after. What about something extremely simple, for

Sync Volume rocker with a UISlider

不羁的心 提交于 2019-12-08 10:32:44
问题 I am trying to get a UISlider to sync with the volume rocker. I have successfully used the slider to change the system/ringer volume, but I need the slider to move when the rocker moves. any suggestions on how to get the current volume value? I am using the code below to monnitor the volume change: - (void)volumeChanged:(NSNotification *)notification{ AVSystemController* avc = SharedAVSystemController; // my sliders name is customVolume, and this is how I // am trying to get the volume:

Increase UISlider height without using image

断了今生、忘了曾经 提交于 2019-12-08 07:07:05
问题 I want to increase UISlider height using color or any other way. I do not want to use image. I do not want to set setMaximumTrackImage & setMinimumTrackImage. How can i implement this ? 回答1: If you don't want to subclass, you can apply scale transform to the slider slider.transform = CGAffineTransformMakeScale(2.0f, 2.0f); 来源: https://stackoverflow.com/questions/36663832/increase-uislider-height-without-using-image

UISlider distorted rounded corner

自作多情 提交于 2019-12-08 03:54:50
问题 I created a UISlider and then setting tint colour for min track like this : [slider setMinimumTrackTintColor:[UIColor whiteColor]]; However I end up with distorted rounded corner on the left side like this. What do I do ? Edit: Here is the code that reproduces the issue : UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(40, 40, 180, 50)]; [slider setMinimumTrackTintColor:[UIColor whiteColor]]; 回答1: I have experienced the same error while increasing the height of the slider. The

Jumpy UISlider when scrubbing - Using UISlider with AVPlayer

怎甘沉沦 提交于 2019-12-08 01:16:31
问题 I am using AvPlayer and am trying to set up a slider to allow scrubbing of audio files. Im having a problem with the slider jumping all over the place when its selected. It then goes back to the origin position for a second before going back to the location it was dragged to. You cant see my cursor on the Gif, but the smooth elongated drags are me moving the knob, then the quick whips are the slider misbehaving. Ive spent hours googling and combing through Stack Overflow and cant figure out