0

I'm animating a UIView, UIText, UILabel and UIImage element in my app to transition into position on button click which works perfectly. However the code I am using doesn't work on a UISlider and I can't figure out way. Can anyone help me out. My code is:

[UIView animateWithDuration:0.8f delay:0.0f options:UIViewAnimationOptionTransitionNone animations: ^{
    if (!viewExpanded) {   //x y width height
        viewExpanded = YES; //going down
        _blueMove.frame = CGRectMake(0, 0, 500, 150); //slide down panel
        _titleLabel.frame = CGRectMake(30, 30, 247, 44); // player title
        _timeElapsed.frame = CGRectMake(40, 95, 34, 21); //time counter
        _duration.frame = CGRectMake(230, 95, 35, 21); //duration
        _playerBg.frame = CGRectMake(0, 84, 320, 45); //player bg colour box

    }else{  //going up
        viewExpanded = NO;
        _blueMove.frame = CGRectMake(0, 0, 500, 0);//slide down panel
        _titleLabel.frame = CGRectMake(30, -40, 274, 44);// player title
        _timeElapsed.frame = CGRectMake(40, -20, 34, 21); //time counter
        _duration.frame = CGRectMake(230, -20, 35, 21); //duration
        //_currentTimeSlider = CGRectMake(40, 0, 175, 34); //time slider
        _playerBg.frame = CGRectMake(0, -45, 320, 45); //player bg colour box


    }

You can see I've commented out an example of what I'm using in the else statement to animate my UISlider but this throws up an error.

Thanks for any help.

1
  • Shouldn't it be _currentTimeSlider.frame = ...?
    – user467105
    Nov 26, 2013 at 16:48

1 Answer 1

0

The code you have posted has the slider commented out

  //_currentTimeSlider = CGRectMake(40, 0, 175, 34); //time slider

And it's also missing .frame

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.