uislider

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

佐手、 提交于 2019-12-03 07:36:54
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 work that way with UIButtons or other touch events like Touch Down . I can work around it, I think,

Vertical UISlider in iOS with autolayout

本小妞迷上赌 提交于 2019-12-03 05:13:13
As per my iPad app requirement, i've to show the UISlider vertically. I'm using iOS7 compiler and deployment target is iOS6. In the story board I added horizontal UISlider of width 600 pixels. I created IBOutlet in my view controller. I didn't set any auto layout constraints. I'm using the below code to rotate and make it vertical. self.slider.transform = CGAffineTransformMakeRotation(M_PI_2); After and before rotation I'm printing the frame size of the slider which is correct. But the slider is not looking proper. Its just showing only knob in the center. How can I rotate the UISlider? I got

How to Change the UISlider to Vertical?

一曲冷凌霜 提交于 2019-12-03 04:37:06
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? PengOne 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: CGAffineTransform trans = CGAffineTransformMakeRotation(M_PI_2); slider.transform = trans; In case you

How to change size of thumb image of UISlider programmatically

て烟熏妆下的殇ゞ 提交于 2019-12-03 03:23:34
I would like to make the custom UISlider, something like this |o----------| -> |-----O------| -> |------------〇| the thumbImage will be small at the minimum value, it will increase the size during the slider value increase, otherwise it will decrease. is anyone know how to do it? Rui Peres You can use this code: + (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize { //UIGraphicsBeginImageContext(newSize); UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0); [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; UIImage *newImage =

How to make UISlider's “track” invisible?

落爺英雄遲暮 提交于 2019-12-03 01:30:14
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. :) here's an even easier way. No need to create images, just instantiate an empty UIImage class :P UIImage *clearImage =

UISlider does not redraw automatically

我只是一个虾纸丫 提交于 2019-12-02 18:52:09
问题 I've an UISlider on my app and I need sometimes to update not only its value but also its minimumValue. The values are changed but if I call the setValue method or assign a new value for my slider, it has the new value but the slider does not repaint itself to the position it should be for this new value. How can I repaint it? This is a piece of code where I change the minimumValue. if([array count] < 50) [sliderTamanyo setMinimumValue:2]; else if([array count] < 200) [sliderTamanyo

Custom Double Handle Slider

风格不统一 提交于 2019-12-02 17:47:02
问题 I was wondering if anyone had some code, or knew of a place that has code for creating a double handled slider. (EX. Kayak application filter results time, has a slider with thumbs on both ends to create a range.) I am looking to do something similar using a double slider to search for a range of ages on a person array. Any help would be great! 回答1: I created a double slider and posted it on GitHub. Blog post: http://dev.doukasd.com/2010/08/double-slider/ GitHub page: https://github.com

UISlider - missing features - snap, tooltip and ticks

ε祈祈猫儿з 提交于 2019-12-02 14:23:20
问题 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

iOS Custom Slider remove min and max space from both ends

﹥>﹥吖頭↗ 提交于 2019-12-02 13:33:01
I'm trying to make custom slider using class MySlider: UISlider { override func trackRect(forBounds bounds: CGRect) -> CGRect { let customBounds = CGRect(origin: bounds.origin, size: CGSize(width: bounds.size.width, height: 5.0)) super.trackRect(forBounds: customBounds) return customBounds } } Updated thumb/max/min tint colour from storyboard The problem is need to remove min and max space from both ends as shown in pics. How i can do that? I was able to achieve this without subclassing: Set Thumb Tint: Default through IB @IBOutlet weak var slider: MySlider! override func viewDidLoad() { super

Custom Double Handle Slider

霸气de小男生 提交于 2019-12-02 12:26:58
I was wondering if anyone had some code, or knew of a place that has code for creating a double handled slider. (EX. Kayak application filter results time, has a slider with thumbs on both ends to create a range.) I am looking to do something similar using a double slider to search for a range of ages on a person array. Any help would be great! Dimitris I created a double slider and posted it on GitHub. Blog post: http://dev.doukasd.com/2010/08/double-slider/ GitHub page: https://github.com/doukasd/iOS-Components/tree/master/Controls/DoubleSlider Let me know how it works for you. Hey, I wrote