uislider

iOS: how to set custom background colour with sliders?

[亡魂溺海] 提交于 2019-12-02 12:26:51
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 will be something; like "red: redSlider / 255" and so on for the other colours? I also don't know where

iOS UISLider with gradient layer

你说的曾经没有我的故事 提交于 2019-12-02 10:59:26
问题 I'm building an iOS application in which I have to implement a custom UISlider. The problem is that the built-in UISlider doesn't support gradient track. Another issue is my UI style guide shows that the current tracking value rectangle should be a gradient of two colors as shown in the image How can I build a customized version of the UISlider? I have thought of either subclassing the existing one or by building a UIControl subclass. I'm using xcode 9.4 and swift 4.2 Thanks in advance! 回答1:

I want to Switch Time scrubber to do 15 min intervals

孤人 提交于 2019-12-02 10:34:42
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((slot % (24 * 3600)) / 3600) comps.minute = Int(slot % 3600 / 60) comps.second = 0 let startedDate = cal

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

亡梦爱人 提交于 2019-12-02 10:25:39
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 = UIImage(cgImage: self.context.createCGImage(self.filteredImage!, from: (self.filteredImage?.extent)!)

UISlider - missing features - snap, tooltip and ticks

余生长醉 提交于 2019-12-02 10:22:43
So I am new to IOS dev and Xcode but far from being a newbie in UI components in many other technologies. I am implementing a UISlider and investigated its API but could not find out how to: add snap behavior (0-9, when end user slides to 3.67 thumb will snap to 4) a checkbox that will show the value @ runtime(like as a hover tooltip) in the storyboard mode without the need to add a label add tics to the slider - 0-9, show a short vertical lines on every round # Could it be that these basic features are missing? I assumed this will be part of the built-in UISlider. Thanks 1 + 2) Yes, there is

Circular UI Slider with Image and Color

旧城冷巷雨未停 提交于 2019-12-02 10:14:19
I am working on an app, with UISlider and need to make it circular. Is it possible via some native code, or does a 3rd party library have to be integrated? I want to fill color as user will slider over slider. You can find 3rd party libraries for circular slider. Take a look into these: https://www.cocoacontrols.com/controls/uicircularslider https://github.com/thomasfinch/Circular-UISlider https://github.com/milianoo/CurvySlider I came across this question in a seperate thread with multiple links and didn't like any of the answers offered so I thought I would add my own in what seemed to be

How do I rewrite a UILabel after it is added to a subView?

此生再无相见时 提交于 2019-12-02 10:03:12
问题 The problem is now fixed. This answer shows an audio application based on the working solution. Initial question I am new to Swift and trying to create a bank of UISliders to test parameters of a physical model in AudioKit. Each UISlider has two UILabels , one to identify the name of a parameter, the other to show a current UISlider value. Tags identify each UISlider and its corresponding UIlabels. I am stuck trying to display current UISlider values in the corresponding UILabel on an iPhone

UIslider buttons doesn't work with checkbox filter

本秂侑毒 提交于 2019-12-02 08:24:26
I try to figure out how to force slider's buttons to move it instead of normal sliding, but keeping the checkbox filter still working by proper way. When I set buttons to move slider then filter doesn't work the way it should. The problem is coming out when i change slider code from: values: [10000], to: value: 10000. Here's my code and jsfiddle example with properly working filter and not working buttons (only slider + checkbox filtering works in that example to show how I need to filter products). https://jsfiddle.net/7er9sxzq/ I'm looking for any help to make it works. CSS: body { font

IOS UISlider non continuos approximate value

隐身守侯 提交于 2019-12-02 06:57:20
问题 I have a UISlider with value between 10 and 100. I works very well. Except I'd like to be able to increase the values by 5 rather than 1 by 1. Now, if I move the slide the values are increasing linear: 10, 11, 12, 13, .... I want to be able when moving the slider the values to increase by 5: 10, 15, 20, 25, .... Is this possible? Many thanks! 回答1: Here's some code for you, base on a stackoverflow post somewhere... - (IBAction)terrainValueChanged:(id)sender { float newStep = roundf(

iOS UISLider with gradient layer

北战南征 提交于 2019-12-02 06:23:30
I'm building an iOS application in which I have to implement a custom UISlider. The problem is that the built-in UISlider doesn't support gradient track. Another issue is my UI style guide shows that the current tracking value rectangle should be a gradient of two colors as shown in the image How can I build a customized version of the UISlider? I have thought of either subclassing the existing one or by building a UIControl subclass. I'm using xcode 9.4 and swift 4.2 Thanks in advance! I ended up solving the problem by setting the gradient layer as an image for the slider minimum track image