我试图循环部分圆圈以实现动画但它只转动180度,然后再从0度开始到180度.因此从180度突然跳到360度.如何在没有任何跳跃的情况下让我的圆形图像对象连续旋转?这是我目前的代码:
UIViewAnimationOptions options = UIViewAnimationOptionCurveLinear|UIViewAnimationOptionRepeat;
[UIView animateWithDuration:ROTATE_ANIMATION_DURATION/2 delay:0 options:options
animations:^{
view.transform = CGAffineTransformRotate(transform, M_PI);}//1st step of animation finished
completion:^(BOOL finished) {
[UIView animateWithDuration:ROTATE_ANIMATION_DURATION/2 delay:0 options:options
animations:^{
view.transform = CGAffineTransformRotate(transform, M_PI);} //2nd step of animation finished
completion:^(BOOL finished) {nil;
}];
Run Code Online (Sandbox Code Playgroud) 我在xcode中添加ui按钮时使用以下代码设置标题标签的文本颜色,对齐方式和字体大小.拾取字体大小但不是文本颜色和对齐方式,为什么?谢谢.
toButton.titleLabel.textColor = [UIColor redColor];
toButton.titleLabel.textAlignment = UITextAlignmentRight;
toButton.titleLabel.font = [UIFont boldSystemFontOfSize:FONT_SIZE];
[toButton setTitle:fromButton.titleLabel.text forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)