문제

I was using InAppSettings to manage my settings but it stopped working in iOS 7 and I couldn't figure out why. So I set out to build my own simple settings tableView. In cellForRowAtIndexPath: I make a slider and add it to my cell like this:

UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(really ugly frame code)];
slider.minimumValue = 0;
slider.maximumValue = 7;
slider.value = 4;
slider.userInteractionEnabled = YES;
[slider addTarget:self action:@selector(slide:) forControlEvents:UIControlEventValueChanged];

[cell addSubview:slider];

The slider shows up perfectly, but I can't interact with it! No matter what I do it won't move. And the target action never gets fired either. The exact same bug I was having with InAppSettings to begin with.

It feels like I am missing something simple, anybody see this before?

도움이 되었습니까?

해결책

Weird. I guess I was initializing the UISlider incorrectly. This code works.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top