开发者

How to implement image animation via an invisible UIslider?

I got a question is using UISlider to control a image animation

And this image has invisible slider to cover on it ...

It looks like this

How to implement image animation via an invisible UIslider?

My question is ... how to adjust image angle ,when I开发者_C百科 change my slide value ???

So that's I can let the image animation from left pic to right pic ???

Thanks

Webber

upload the sample code Here

Hope someone can help me to figure out this problem


Do you want to rotate the image? Then use:

imageView.transform =  GAffineTransformRotate(imageView.transform,RADIANS(degreesToRotate));


- (IBAction)changeSliderValue:(id)sender{
    int progressAsInt =(int)(invisibleSlider.value);
    if (progressAsInt==0) {
        [dimmerImg setImage:[UIImage imageNamed:@"slider0.png"]];
    }
    else {
        [dimmerImg setImage:[UIImage imageNamed:@"slider99.png"]];
        CGAffineTransform transform = CGAffineTransformIdentity;
        dimmerImg.transform = CGAffineTransformRotate(transform, progressAsInt * M_PI / 180);
        //dimmerImg.transform = CGAffineTransformRotate(dimmerImg.transform, progressAsInt);
    }
}

This works fine ~

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜