2

我有一个问题,我正在使用 UISlider,我有一组图片 4 或 5,我有四个视图,每个视图都有动画,我不能在模拟器中滑动,但它适用于 iphone 5。当我测试这个应用程序时,它适用于 iphone 5 但不适用于 iphone 4 或 4s

我对这个滑块代码有两个操作: - (void)viewDidLoad { [super viewDidLoad];

[self showSaveButton];


imgArrayDate = [NSArray arrayWithObjects:
                [NSString stringWithFormat:@"date1.png"],
                [NSString stringWithFormat:@"dateDay.png"],
                [NSString stringWithFormat:@"dateWeek.png"],
                [NSString stringWithFormat:@"dateYear.png"],
                nil];

} - (IBAction)sliderDateChanged:(id)sender { [sliderDate setImage:[UIImage imageNamed:[imgArrayDate objectAtIndex:dateSlider.value]]];

}

  • (IBAction)clickDateButton:(id)sender {

    [日期视图设置隐藏:否];

    [sliderDate setImage:[UIImage imageNamed:[imgArrayDate objectAtIndex:0]]];

    [dateSlider setMaximumValue:3];

    self.imageV.alpha = 0.2; [UIView animateWithDuration:0.8 动画:^{ [dateSlider setContinuous:NO]; [dateView setCenter:CGPointMake([mainView center].x, [mainView center].y/2)];

    }完成:^(布尔完成){

    }];

当我完成拖动时 - (IBAction)hideSliderDate:(id)sender forEvent:(UIEvent *)event { UITouch *touchEvent = [[event allTouches] anyObject];

if (touchEvent.phase == UITouchPhaseEnded) {  
    [dateButton setBackgroundImage:sliderDate.image forState:normal];
    [dateView setHidden:YES];

}

}

我不明白为什么我无法控制这个滑块

4

0 回答 0