Develop
2013.10.31 16:59
[ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)
조회 수 45448 댓글 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] 학교 건물 최단거리 찾는 웹 연동 프로그램 | hooni | 2013.04.23 | 6800 |
252 | Develop | [js] ajax를 이용해 외부문서 불러오기.. | hooni | 2013.04.23 | 6796 |
251 | Develop | [js] 숫자만 입력하게 하는 자바스크립트 | hooni | 2013.04.23 | 6795 |
250 | Develop | [js] One Time Pad key generatorㅡ.,ㅡ; | hooni | 2013.04.23 | 6790 |
249 | Develop | [c] 문자열 컨트롤 함수로 만든 프로그램들.. | hooni | 2003.04.23 | 6786 |
248 | Develop | [php] 피코맥스용 검색엔진 ㅋㅋ | hooni | 2013.04.23 | 6781 |
247 | Develop | [c] 파일 복사(copy) 프로그램 샘플 소스 | hooni | 2003.04.23 | 6770 |
246 | Develop | [js] 실행되는 디렉토리 확인하는 스크립트.. | hooni | 2013.04.23 | 6766 |
245 | Develop | [js] 한글문서로 된 259가지 자바스크립트 예제파일 | hooni | 2013.04.23 | 6764 |
244 | Develop | [c] 시간 계산 하는 프로그램 소스코드 | hooni | 2003.04.23 | 6745 |
243 | Develop | [c] 프로그래밍 과제..(colprint) | hooni | 2003.04.23 | 6745 |
242 | Develop | [js] 윈도우 시작버튼처럼 나오는 메뉴 | hooni | 2013.04.23 | 6743 |