Develop
2013.10.31 16:59
[ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)
조회 수 45492 댓글 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 •
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
253 | Develop |
[c] 단기과정[01/14] 피보나치, 파스칼.. 파일입출력
![]() |
hooni | 2003.04.23 | 7103 |
252 | Develop |
[c] 단기과정[01/14] 파일 입출력
![]() |
hooni | 2003.04.23 | 6851 |
251 | Develop |
[c] 단기과정[01/10] 과제.. swap(any data, ..)
![]() |
hooni | 2003.04.23 | 6926 |
250 | Develop | [c] 단기과정[01/08] 배열, 포인터 | hooni | 2003.04.23 | 7251 |
249 | Develop |
[c] 단기과정[01/08] 과제.. 파스칼 삼각형
![]() |
hooni | 2003.04.23 | 7274 |
248 | Develop | [c] 단기과정[01/08] (다차원 + 배열)포인터, void 포인터 | hooni | 2003.04.23 | 7786 |
247 | Develop | [c] 단기과정[01/07] 제어문, 피보나치수열 | hooni | 2003.04.23 | 7422 |
246 | Develop | [c] 단기과정[01/06] sizeof, 실수표현, 메모리, 연산자 | hooni | 2003.04.23 | 6946 |
245 | Develop |
[c] 다중연결 서버 만들기 #4 - thread 사용
![]() |
hooni | 2013.04.23 | 23734 |
244 | Develop |
[c] 다중연결 서버 만들기 #3 - poll() 사용
![]() |
hooni | 2013.04.23 | 6360 |
243 | Develop |
[c] 다중연결 서버 만들기 #2 - select() 사용
![]() |
hooni | 2013.04.23 | 9371 |
242 | Develop |
[c] 다중연결 서버 만들기 #1 - fork() 사용
![]() |
hooni | 2013.04.23 | 12942 |