initWithFrame
메도 내부 UIView
클래스
을 가지고 :
// call this methode from the class where u want to animate custom indicator
(void)startAnimating
{
[customActivityIndicatorstartAnimating];
}
가 메도 보자 :
//this method create custom activity indicator
UIImage *startImage = [UIImage imageNamed:@"1.png"];
customActivityIndicator = [[UIImageView alloc] //take in in .h file
initWithImage:startImage ];
//Add more images which to be used for the animation
customActivityIndicator.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
[UIImage imageNamed:@"4.png"],
[UIImage imageNamed:@"5.png"],
[UIImage imageNamed:@"6.png"],
[UIImage imageNamed:@"7.png"],
[UIImage imageNamed:@"8.png"],
nil];
//Set animation duration
customActivityIndicator.animationDuration = 0.5;
//set frame at the middle of the imageview
customActivityIndicator.frame = self.frame;
가 메도 가지고
// call this methode from the class where u want to stope animate custom
(void)stopAnimating
{
[customActivityIndicatorstaopAnimating];
}
생각을 추가, 뷰를 하위 뷰로 만들면 이전 수퍼 뷰에서 자동으로 제거됩니다. 내가 틀렸다면 나에게 맞춰주세요. – eugene
알려주세요. 내 테스트에서, 그것은 superview에서 autoremove하지 않았다. 싱글벙 광고를 많은 수퍼 뷰에 추가 할 때 수퍼 뷰 중 아무도 그것을 표시 할 수 없습니다 (모두 블랙 아웃 됨). 또한 활동 지표가오고가는 경우는 어떻습니까? 예를 들어 활동을 시작하여 현재보기에 표시한다고 가정 해 보겠습니다. 활동 도중 새로운보기를 누른 다음 활동이 끝난 후 다시 팝업됩니다. 활동을 읽어야하는지 여부를 어떻게 처리할까요? viewcontrlr 당 활동 표시기를 유지하는 것이 훨씬 쉬우 며 각 핸들에 대한 대리자 메소드가 표시/숨기기되도록합니다. –
thx, best solution – SamuelChan