2012-10-19 1 views
0

내 응용 프로그램에서 View1의 뷰 load()에서 일부 애니메이션을 설정합니다. 처음에는 otherview에 푸시 된 경우 메신저가 작동하고, view1에 팝업되면 애니메이션이 표시되지 않습니다. 다른보기에서 팝업보기 동안 애니메이션? 여기 내가팝업보기에서 Viewdid로드 메서드 호출

과 노력

- (void)viewDidLoad 
{ 
artext=[[NSMutableArray alloc] init]; 
arimage=[[NSMutableArray alloc] init]; 
arsound=[[NSMutableArray alloc] init]; 

[super viewDidLoad]; 
[self copysqlitetodocuments]; 
[self Readthesqlitefile]; 
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage  imageNamed:@"classroom.png"]]; 

} 

내보기 한 부하 코드,

- (void)viewDidAppear:(BOOL)animated 
{ 
[self buttonmover]; 
[super viewDidAppear:animated]; 
    } 

는이 문제

+0

what to animate? – vishy

+0

내 buttonmover 함수는 애니메이션을 제공합니다.보기를 시도해 보았습니다. 처음 시작했을 때, 그 애니메이션이 보이지 않는 다른보기에서 팝업이 나옵니 까? @vishy – iosdev

+0

우리에게 버튼 이동 기능을 보여줍니다. – vishy

답변

0

를 해결하기 위해, 하나는 PLS 나를 도울 수 작동하지 y 보기가 표시되면 코드를 실행하고 싶습니다. 애니메이션), -viewDidLoad은 잘못된 위치입니다. 뷰 계층에 아직

- (void)viewDidAppear:(BOOL)animated { 
    [super viewDidAppear:animated]; 
    // ... 
} 
+0

또는 viewWillAppear 때때로 로딩이 약간 더 부드럽게 보이게합니다 –

0

시도 viewWillAppear

당신의 viewDidLoad 메소드를 호출
-(void)viewWillAppear:(BOOL)animated 
{ 
    artext=[[NSMutableArray alloc] init]; 
    arimage=[[NSMutableArray alloc] init]; 
    arsound=[[NSMutableArray alloc] init]; 

    [self copysqlitetodocuments]; 
    [self Readthesqlitefile]; 
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"classroom.png"]]; 

} 
0

에서, 컨트롤러, 그래서 애니메이션하지 않습니다 :

당신은 아마 사용해야합니다 작업.

당신은있어서 [슈퍼 viewWillAppear] 구현 후, viewWillApper에 애니메이션을 수행한다. 다음과 같음 :

- (void)viewDidAppear:(BOOL)animated { 
    [super viewDidAppear:animated]; 

    artext = [[NSMutableArray alloc] init]; 
    arimage = [[NSMutableArray alloc] init]; 
    arsound = [[NSMutableArray alloc] init]; 

    [self copysqlitetodocuments]; 
    [self Readthesqlitefile]; 
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"classroom.png"]]; 

} 
+0

다른보기에서 다시 팝하는 동안 애니메이션이 표시됩니까? – iosdev

+0

그래서 처음으로 애니메이션이 필요합니까? –

+0

아니요 애니메이션보기를 원합니다. 내가보기로 돌아갑니다. – iosdev