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 | [c] 웹 메모장.. ㅋㅋ | hooni | 2013.04.23 | 6848 |
588 | Develop | [c++] 프리렉(freelec) 예제 자료.. ㅋㄷ | hooni | 2013.04.23 | 6854 |
587 | Develop | [c] 문자열 str_shift 예제.. | hooni | 2013.04.23 | 6855 |
586 | Develop | [c] 단기과정[01/14] 파일 입출력 | hooni | 2003.04.23 | 6862 |
585 | Develop | [js] 숫자만 입력하게 하는 자바스크립트 | hooni | 2013.04.23 | 6863 |
584 | Develop | [pdf] 윈도우즈 95 시스템 프로그래밍(Windows 95 system programming) | hooni | 2013.04.23 | 6866 |
583 | Develop | [js] get방식, url이후 모두 그대로 읽어오기.. | hooni | 2013.04.23 | 6867 |
582 | Develop | [ajax] 샘플 코드와 한글처리에 대한 간단한 설명 | hooni | 2013.04.23 | 6874 |
581 | Develop | [js] 사라지는 브라우저 | hooni | 2003.04.23 | 6879 |
580 | Develop | [c] 라인수 입력받아 마름모꼴 출력하기.. | hooni | 2003.04.23 | 6899 |
579 | Develop | [js] 수명체크 프로그램 ㅋㅋ | hooni | 2013.04.23 | 6904 |
578 | Develop | [c] 간단한 순위 루틴.. (정보처리기사) | hooni | 2003.04.23 | 6905 |