안녕하세요 여러분, 내 응용 프로그램에 대한 소개 이미지 (페이드 인 및 페이드 아웃)를 만들고 싶습니다. 는 여기 장치에 응용 프로그램을 실행할 때 나는 문제가, 내 코드지만 :Image iphone 응용 프로그램 시작시 소개
- 내 주요 펜촉 페이지가 표시되었습니다
- 내 이미지가 페이드하고 페이드 아웃 후 다시 페이드 및 3 번 페이드 아웃
여기 내 코드와 첨부 파일이 있습니다. 그것을 확인하시기 바랍니다 :
.H
@interface myProject : UIViewController {
float alphaValue, imageAlphaValue;
}
UIImageView *IntroImage;
NSTimer *AlphaTimer;
@end
하는 .m
-(void)viewDidLoad
{
imageAlphaValue = 0.0;
alphaValue = 0.035;
IntroImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[self.view addSubview:IntroImage];
[IntroImage setImage:[UIImage imageNamed:@"yourimagenamehere.png"]]; //use your image here
[IntroImage setBackgroundColor:[UIColor blueColor]];
[IntroImage setAlpha:imageAlphaValue];
[IntroImage release];
AlphaTimer = [NSTimer scheduledTimerWithTimeInterval:(0.05) target:self selector:@selector(setAlpha) userInfo:nil repeats:YES];
[NSTimer scheduledTimerWithTimeInterval:(2.0) target:self selector:@selector(changeAlpha) userInfo:nil repeats:NO];
}
-(void)setAlpha
{
imageAlphaValue = imageAlphaValue + alphaValue;
[IntroImage setAlpha:imageAlphaValue];
}
-(void)changeAlpha
{
alphaValue = -0.035;
}
방금 변경 같은 것을 사용 할 수없는 이유 my sample code