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 | 6937 |
380 | Develop | [c] 도메인(호스트)으로 IP정보 알아오기.. (nslookup과 비슷) | hooni | 2013.04.23 | 6935 |
379 | Develop | [c] 단기과정[01/06] sizeof, 실수표현, 메모리, 연산자 | hooni | 2003.04.23 | 6931 |
378 | Develop | [php] 빔 프로젝터 예약 프로그램.. ㅋㅋ | hooni | 2013.04.23 | 6926 |
377 | Develop | [c] 소켓의 세가지 동작모드 | hooni | 2003.04.23 | 6914 |
376 | Develop | [c] 프로세스 정보 출력하기.. | hooni | 2003.04.23 | 6911 |
375 | Develop | [c] 맵서치인 듯(옛날 컴에서 찾은 자료) | hooni | 2013.04.23 | 6905 |
374 | Develop | [c] 단기과정[01/10] 과제.. swap(any data, ..) | hooni | 2003.04.23 | 6905 |
373 | Develop | [c] pcapdump 파일 분석 하는 프로그램.. ㅋㅋ | hooni | 2013.04.23 | 6903 |
372 | Develop | [c] 프로세스간의 통신(파이프) | hooni | 2003.04.23 | 6893 |
371 | Develop | [c] 간단한 순위 루틴.. (정보처리기사) | hooni | 2003.04.23 | 6874 |
370 | Develop | [c] 라인수 입력받아 마름모꼴 출력하기.. | hooni | 2003.04.23 | 6873 |