Develop
2013.10.31 16:59
[ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)
조회 수 45558 댓글 0
iconImages 배열과 charImages 배열을 합침
샘플코드 설명~
배열 앞/뒤 순서는 넌스에 따라 랜덤하게 적용하고 애니메이션 적용까지..
NSArray *iconImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"00_splash_loding_icon_01"], [UIImage imageNamed:@"00_splash_loding_icon_02"], [UIImage imageNamed:@"00_splash_loding_icon_03"], [UIImage imageNamed:@"00_splash_loding_icon_04"], [UIImage imageNamed:@"00_splash_loding_icon_05"], [UIImage imageNamed:@"00_splash_loding_icon_06"], [UIImage imageNamed:@"00_splash_loding_icon_07"], [UIImage imageNamed:@"00_splash_loding_icon_08"],nil]; NSArray *charImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"00_splash_loding_char_01"], [UIImage imageNamed:@"00_splash_loding_char_02"], [UIImage imageNamed:@"00_splash_loding_char_03"], [UIImage imageNamed:@"00_splash_loding_char_04"], [UIImage imageNamed:@"00_splash_loding_char_05"], [UIImage imageNamed:@"00_splash_loding_char_06"],nil]; NSArray *animationImages = (arc4random()%2 > 0) ? [iconImages arrayByAddingObjectsFromArray:charImages] : [charImages arrayByAddingObjectsFromArray:iconImages]; loadingActivityIndicator_ = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 24, 24)]; // 34x35 loadingActivityIndicator_.animationDuration = 2.0; loadingActivityIndicator_.animationRepeatCount = 0; loadingActivityIndicator_.animationImages = animationImages; loadingActivityIndicator_.contentMode = UIViewContentModeScaleAspectFit; [loadingActivityIndicator_ setCenter:activityPt]; [containerView_ addSubview:loadingActivityIndicator_]; //애니메이션 시작 [loadingActivityIndicator_ startAnimating]; //애니메이션 정지 [loadingActivityIndicator_ stopAnimating];
TAG •
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
589 | Develop | [java] Sieve of Eratosthenes (에라토스테네스의 체) | hooni | 2013.04.23 | 9348 |
588 | Develop | [js] 사진첩에 쓸 내용 - 마우스 오버로 바꾸기 | hooni | 2013.04.23 | 6362 |
587 | Develop | [js] 폼(form) 전송시 중복 클릭 방지 간단한 구문 | hooni | 2013.04.23 | 9328 |
586 | Develop | [ajax] 샘플 코드와 한글처리에 대한 간단한 설명 | hooni | 2013.04.23 | 6874 |
585 | Develop | [c] 전위 표기법으로 연산 예제.. | hooni | 2013.04.23 | 9321 |
584 | Develop | [c] 프로그램 코드(c/c++)를 html 파일로 변환 | hooni | 2013.04.23 | 7695 |
583 | Develop | [c] 구조체 배열 예제 (학생 성적 계산) | hooni | 2013.04.23 | 7690 |
582 | Develop | [c] 숫자 맞추는 게임.. | hooni | 2013.04.23 | 6952 |
581 | Develop | [js] php의 number_format() 함수와 같은.. ㅋㅋ | hooni | 2013.04.23 | 6951 |
580 | Develop | [c] 베이지언(Bayesian) 패턴인식 과제 ㅋㅋ | hooni | 2013.04.23 | 7116 |
579 | Develop | [c] KNN(K-nearest neighbor) 패턴인식 과제.. | hooni | 2013.04.23 | 7414 |
578 | Develop | [php] 날짜 정보 출력 (년,월,일,시,분,초) | hooni | 2013.04.23 | 10579 |