Develop
2013.10.31 16:59
[ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)
Views 45602 Comment 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 •
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
37 | Develop | [android] ListView+ArrayAdapter 테스트 | hooni | 2013.04.23 | 43961 |
36 | Develop | [android] keytool을 사용하여 키스토어 생성 | hooni | 2013.04.23 | 69582 |
35 | Develop | [android] How can I place app icon on launcher home screen? | hooni | 2016.11.15 | 1423 |
34 | Develop | [android] GCM 사용하기 1 (GCM 서비스 신청하기) | hooni | 2013.07.06 | 51430 |
33 | Develop | [android] dp, px 서로 변환 | hooni | 2016.10.21 | 3512 |
32 | Develop | [android] Canvas를 이용해 이미지 확대/축소 하기 | hooni | 2013.04.23 | 60801 |
31 | Develop | [android] Calling activity function from separate class | hooni | 2016.11.15 | 1320 |
30 | Develop | [android] ArrayAdapter를 이용하여 출력하기 | hooni | 2013.04.23 | 47397 |
29 | Develop | [android] ArrayAdapter 테스트 파일 ㅎㅎ | hooni | 2013.04.23 | 45298 |
28 | Develop | [android] Android N requires the IDE to be running with Java 1.8 or later 오류 | hooni | 2016.08.30 | 959 |
27 | Develop | [android] AlertDialog 메시지 창 띄우기 | hooni | 2015.07.09 | 993 |
26 | Develop | [Android] 2010년에 만들었던 세미나 자료. | hooni | 2013.05.28 | 64750 |