Develop
2013.10.31 16:59
[ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)
조회 수 45434 댓글 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 | [java] 채팅창 처럼.. swing.. | hooni | 2013.04.23 | 8769 |
252 | Develop | [java] 채팅창 처럼2.. swing.. | hooni | 2013.04.23 | 6421 |
251 | Develop | [java] 초간단 싱글톤(Singleton) 패턴 샘플 코드 | hooni | 2013.11.18 | 11591 |
250 | Develop | [java] 컴포넌트 배치 ㅡ.,ㅡ; | hooni | 2003.04.23 | 7143 |
249 | Develop | [java] 파일 라인수 계산하는 프로그램 (하위 디렉토리까지..) | hooni | 2013.04.23 | 7646 |
248 | Develop | [json] 종결자 (설명과 웹, C/C++/C# 프로그램 샘플 코드) | hooni | 2013.04.23 | 71971 |
247 | Develop | [jsp] Get방식, Post방식 전송 예제.. | hooni | 2003.04.23 | 13754 |
246 | Develop | [jsp] HelloServlet 출력문 | hooni | 2003.04.23 | 7786 |
245 | Develop | [jsp] RSS(xml) 파싱해서 보여주기 ㅎㅎ | hooni | 2013.04.23 | 13202 |
244 | Develop | [jsp] 유효성체크(Client, Server 에서) | hooni | 2003.04.23 | 7414 |
243 | Develop | [jsp] 정적/동적(차트생성) 이미지 전달 | hooni | 2003.04.23 | 7307 |
242 | Develop | [jsp] 초간단한 include 구문 예제.. | hooni | 2013.04.23 | 7227 |