我正在尝试在使用淡入淡出效果的imageview中制作幻灯片.
到目前为止我做到了这一点:
- (void)viewDidLoad
{
[super viewDidLoad];
animationView = [[UIImageView alloc] initWithFrame:self.view.frame];
animationView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"photo1.jpg"],
[UIImage imageNamed:@"photo2.jpg"],
[UIImage imageNamed:@"photo3.jpg"], nil];
animationView.animationDuration = 5;
animationView.animationRepeatCount = 0;
[animationView startAnimating];
[self.view addSubview:animationView];
}
Run Code Online (Sandbox Code Playgroud)
图像确实一个接一个地出现,在5秒的延迟中,我现在想要的是每次出现图像时使它们淡入和淡出,对此有何建议?
在此先感谢您的帮助
这可能是一个noob问题,但我一直试图弄清楚几个小时,我不能.我想让一个标签显示一个整数变量的数量.
我所做的是我已经将变量x声明为整数,我将该变量赋予数字100然后我试图将该数字显示为标签.
我试过这个,但它不起作用.
x = 100;
label.text = [[NSString alloc] initWithFormat:@"%.2f",x];
这发生在一个按钮内.
提前致谢