uislider

Animate UISlider smoothly

吃可爱长大的小学妹 提交于 2019-12-21 01:21:14
问题 i want to animate an UISlider for e.g. 0.25 to 0.75 and back. This should show the user what is to do. i tried this: [self incrementCounter:[NSNumber numberWithInt:0]]; -(void) incrementCounter:(NSNumber *)i { [Slider setValue:[i floatValue]/1000]; [self performSelector:@selector(incrementCounter:) withObject:[NSNumber numberWithInt:i.intValue+1] afterDelay:0.001]; } but thats not so smooth... can i use transitions for this? [Slider setValue:1 animated:YES]; is to fast... [UIView

UISlider returns two Touch Up Inside events, why does that happen?

不打扰是莪最后的温柔 提交于 2019-12-21 01:18:30
问题 I have a slider that I'm using to set a float value somewhere. I connect Value Changed to a method in my viewController. That part works fine. I need to know when the user starts touching the control but not necessarily every single instant that the slider changes (I receive the Value Changed events for that). So I connected a Touch Up Inside event to another method in the viewController. The problem it, that method gets called twice when the user touches the UISlider control. WTF? It doesn't

How to Change the UISlider to Vertical?

血红的双手。 提交于 2019-12-20 16:54:21
问题 I am customizing an UISlider for my app. I want the slider to be in vertical orientation, but the default UISlider is in horizontal orientation. I couldn't find how to change a UISlider 's orientation. How can I make a vertical slider in XCode? 回答1: By default, a UISlider is horizontal (--). If you wish to make it vertical (|) then you must do this programmatically, probably with a CGAffineTransform . For example, you can add this snippet to viewDidLoad or wherever you deem appropriate:

How to make UISlider's “track” invisible?

南笙酒味 提交于 2019-12-20 11:37:01
问题 I'm trying to emulate Apple's "Slide to Unlock" feature in my application. I get to this point (image below), but as you can see the UISlider's "track" is visible and is covering up my text. Is there a way to change an attribute programmatically that will make the "track" invisible? Please let me know if you need any of my code. Thanks in advance! EDIT: If I change the slider's alpha to 0, it gets rid of my sliding button, so doing that won't work unless I'm doing it wrong. :) 回答1: here's an

How to make UISlider's “track” invisible?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 11:35:32
问题 I'm trying to emulate Apple's "Slide to Unlock" feature in my application. I get to this point (image below), but as you can see the UISlider's "track" is visible and is covering up my text. Is there a way to change an attribute programmatically that will make the "track" invisible? Please let me know if you need any of my code. Thanks in advance! EDIT: If I change the slider's alpha to 0, it gets rid of my sliding button, so doing that won't work unless I'm doing it wrong. :) 回答1: here's an

Javascript slider that scrolls along both dates and times

こ雲淡風輕ζ 提交于 2019-12-20 11:09:25
问题 I've seen some nice examples of jQuery sliders that select date ranges: http://ghusse.github.com/jQRangeSlider/stable/demo/ And time ranges: http://marcneuwirth.com/blog/2011/05/22/revisiting-the-jquery-ui-time-slider/ But I'm looking for something that will be able to select date ranges down to the month, day, minute. It would be great to be able to have it as both a date range selector and a plain slider. Has anyone seen an implementation like that? Would the normal jQuery UI slider using

I want to Switch Time scrubber to do 15 min intervals

非 Y 不嫁゛ 提交于 2019-12-20 06:19:22
问题 Please Suggest me i want to go in 15 minute intervals. ex: 4:00, 4:15, 4:30, 4:45 and so next. @IBAction func sliderMoved(sender: UISlider) { let slot = Double(sender.value) let slotDate = self.timeFromSlot(slot) print(timeFormatter.stringFromDate(slotDate!)) } private func timeFromSlot(slot:Double) -> NSDate? { let cal = NSCalendar.currentCalendar() let unit:NSCalendarUnit = [.Year, .Month, .Day, .Hour, .Minute, .Second] let comps = cal.components(unit, fromDate: NSDate()) comps.hour = Int(

iOS: how to set custom background colour with sliders?

拟墨画扇 提交于 2019-12-20 05:41:08
问题 First off I want to say I saw a couple of posts on this site about how to do this, although none seemed to work for me so please don't close this down until I get it working. What I want to do is make the background of the view change depending on the value of the sliders are, so that the user can choose the background colour they want. self->colorView.backgroundColor = [UIColor myColor]; myColor = I figure I'll need a bit of code like that, although I don't know how to define what my colour

iOS: how to set custom background colour with sliders?

浪子不回头ぞ 提交于 2019-12-20 05:41:03
问题 First off I want to say I saw a couple of posts on this site about how to do this, although none seemed to work for me so please don't close this down until I get it working. What I want to do is make the background of the view change depending on the value of the sliders are, so that the user can choose the background colour they want. self->colorView.backgroundColor = [UIColor myColor]; myColor = I figure I'll need a bit of code like that, although I don't know how to define what my colour

How change kCIInputBrightnessKey using slider value in Swift, I'm getting either white or black picture whatever value the slider get

旧街凉风 提交于 2019-12-20 04:57:28
问题 The minimum value of the slider is -1 the maximum value is +1. @IBAction func changeContrast(_ sender: UISlider) { DispatchQueue.main.async { let beginImage = CIImage(image: self.myImageView.image!) self.filter = CIFilter(name: "CIColorControls") self.filter?.setValue(beginImage, forKey: kCIInputImageKey) self.filter.setValue(sender.value, forKey: kCIInputBrightnessKey) print("Current value of the slider - \(sender.value)") self.filteredImage = self.filter?.outputImage self.myImageView.image