Develop
2013.10.31 16:59
[ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)
조회 수 45461 댓글 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 •
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
381 | Develop | [c] 최대공약수, 최소공배수, 서로소 구하기 (펌) | hooni | 2013.04.23 | 11165 |
380 | Develop | [c] 최대공약수 알고리즘 (유클릿) | hooni | 2003.04.23 | 8877 |
379 | Develop | [c] 최단거리 알고리즘 & 예제소스.. 13 | hooni | 2013.04.23 | 10172 |
378 | Develop | [c] 지폰(gphone) 소스.. 수정(암호화) | hooni | 2013.04.23 | 7436 |
377 | Develop | [c] 지나가는 패킷 잡기 | hooni | 2003.04.23 | 8814 |
376 | Develop | [c] 정수를 2진수로 변환 (재귀,비트연산) | hooni | 2003.04.23 | 7584 |
375 | Develop | [c] 정사각배열의 서브 배열의 최대 값 구하기 | hooni | 2003.04.23 | 7025 |
374 | Develop | [c] 전위 표기법으로 연산 예제.. | hooni | 2013.04.23 | 9308 |
373 | Develop | [c] 재미있는 코딩.. | hooni | 2003.04.23 | 21327 |
372 | Develop | [c] 자료구조 그래프(graph) 소스코드 - 확인해볼 것.. | hooni | 2013.04.23 | 7997 |
371 | Develop | [c] 이진트리/트리 순회법 코드(전위/중위/후위) 5 | hooni | 2015.07.02 | 20944 |
370 | Develop | [c] 이진트리(binary tree)의 특성 | hooni | 2003.04.23 | 9611 |