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 •
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
805 | Develop | How to Test SMTP AUTH using Telnet | hooni | 2018.04.05 | 1364 |
804 | Develop | [python] DJI Tello 드론 코딩 (프로그래밍) 58 | hooni | 2018.03.04 | 25805 |
803 | Develop | What is difference between Get, Post, Put and Delete? | hooni | 2018.02.28 | 1422 |
802 | Develop | [php] Laravel Route에서 PC/Mobile 분기 | hooni | 2018.01.24 | 2509 |
801 | Develop | Laravel 5 Failed opening required bootstrap/../vendor/autoload.php | hooni | 2018.01.24 | 1678 |
800 | Develop | [php][laravel] 라라벨 개발환경 세팅하기 (Mac, Window) 2 | hooni | 2017.12.15 | 2612 |
799 | Develop | [php][laravel] 라라벨 프로젝트 생성 및 구조 | hooni | 2017.12.15 | 2402 |
798 | Develop | [php][laravel] 초간단 MacOS에서 Laravel 개발 환경 구축 | hooni | 2017.12.15 | 1908 |
797 | Develop | [js] 문자열에서 숫자만 걸러내기 (jQuery 안쓰고 정규표현식) | hooni | 2017.12.14 | 1128 |
796 | Develop | [js] URL 파싱하기 (jQuery 안쓰고) | hooni | 2017.12.14 | 1326 |
795 | Develop | [php] Laravel 5.4: Specified key was too long error | hooni | 2017.12.04 | 9243 |
794 | Develop | [php] mysql_ 과 mysqli_ 의 차이 | hooni | 2017.12.01 | 1709 |