'iOS > Skills' 카테고리의 다른 글
아이폰 카메라 연동 소스 (0) | 2011.07.05 |
---|---|
font 변경 (0) | 2011.06.29 |
네비게이션 타이틀 글자 크기 조절 (0) | 2011.06.20 |
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
아이폰 카메라 연동 소스 (0) | 2011.07.05 |
---|---|
font 변경 (0) | 2011.06.29 |
네비게이션 타이틀 글자 크기 조절 (0) | 2011.06.20 |
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
[기능]
- 카메라를 통한 사진 선택
- 롤 이미지에서 사진 선택
- 도큐먼트에 이미지 저장
- 새로 실행할때 도큐먼트 이미지 로드 기능
출처:
http://iamgsi.tistory.com/542http://blueamor.tistory.com/786
10 iPhone Memory Management Tips (0) | 2011.08.29 |
---|---|
font 변경 (0) | 2011.06.29 |
네비게이션 타이틀 글자 크기 조절 (0) | 2011.06.20 |
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
10 iPhone Memory Management Tips (0) | 2011.08.29 |
---|---|
아이폰 카메라 연동 소스 (0) | 2011.07.05 |
네비게이션 타이틀 글자 크기 조절 (0) | 2011.06.20 |
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
아이폰 카메라 연동 소스 (0) | 2011.07.05 |
---|---|
font 변경 (0) | 2011.06.29 |
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
UITableView 당겨서 업데이트 (0) | 2011.06.14 |
font 변경 (0) | 2011.06.29 |
---|---|
네비게이션 타이틀 글자 크기 조절 (0) | 2011.06.20 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
UITableView 당겨서 업데이트 (0) | 2011.06.14 |
모달 뷰 사용(일종의 팝업 윈도우) (1) | 2010.11.23 |
네비게이션 타이틀 글자 크기 조절 (0) | 2011.06.20 |
---|---|
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
UITableView 당겨서 업데이트 (0) | 2011.06.14 |
모달 뷰 사용(일종의 팝업 윈도우) (1) | 2010.11.23 |
애니메이션 주기 (0) | 2010.11.10 |
UIImage 사이즈 변경하기 (0) | 2011.06.15 |
---|---|
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
모달 뷰 사용(일종의 팝업 윈도우) (1) | 2010.11.23 |
애니메이션 주기 (0) | 2010.11.10 |
UIAlertView without Buttons - Please Wait Dialog (0) | 2010.07.21 |
ios3 -> ios4 CGImageRef 이미지 출력 속도 저하 (0) | 2011.06.15 |
---|---|
UITableView 당겨서 업데이트 (0) | 2011.06.14 |
애니메이션 주기 (0) | 2010.11.10 |
UIAlertView without Buttons - Please Wait Dialog (0) | 2010.07.21 |
MBProgressHUD (0) | 2010.07.21 |
UIImageView 의 IBOutlet 하나 필요, (helicopterImageVew)
충돌을 확인할 UIImageView 의 IBOutlet 도 하나 필요(birdImageView)
경로를 따라 이동하는 Path 버튼과 프로펠러 회전을 시키는 Swing 버튼을 위한 두 개의 IBAction 필요
//초기화 부분..
{
...
UIImage *heliImage1 = [UIImage imageNamed:@"heli_1.png"];
UIImage *heliImage2 = [UIImage imageNamed:@"heli_2.png"];
UIImage *heliImage3 = [UIImage imageNamed:@"heli_3.png"];
UIImage *heliImage4 = [UIImage imageNamed:@"heli_4.png"];
UIImage *heliImage5 = [UIImage imageNamed:@"heli_5.png"];
UIImage *heliImage6 = [UIImage imageNamed:@"heli_6.png"];
NSArray *animationImageArray = [NSArray arrayWithObjects:heliImage1, heliImage2,
heliImage3, heliImage4, heliImage5, heliImage6, nil];
helicopterImageView.animationImages = animationImageArray;
helicopterImageView.animationDuration = 0.1;
- (IBAction)toggleFlay:(id)sender
{
if ([helicopterImageView isAnimating]){
[helicopterImageView stopAnimating];
} else {
[helicopterImageView startAnimating];
}
}
- (IBAction)moveThroughPath:(id)sender
{
birdImageView.hidden = NO;
//패쓰 만들기
CGMutablePathRef aniPath = CGPathCreateMutable();
CGPoint currCenter = helicopterImageView.center;
CGAffineTransform xform = CGAffineTransformIdentity;
CGPathMoveToPoint(aniPath, &xform, currCenter.x, currCenter.y);
CGPathAddCurveToPoint(aniPath, &xform, -200, currCenter.y, 520, 400, 160, 400);
//애니메이션 만들기
CAKeyframeAnimation *keyAni = [CAKeyframeAnimation animation];
keyAni.duration = 4.0;
keyAni.path = aniPath;
keyAni.rotationMode = kCAAnimationRotateAutoReverse;
//레이어에 애니메이션을 더한다
[NSTimer scheduledTimerWithTimeInterval:0.1
target:self
selector:@selector(collisionCheck:) userInfo:nil repeats:YES];
[helicopterImageView.layer addAnimation:keyAni forKey:@"position"];
}
- (void)collisionCheck:(NSTimer *)timer
{
CALayer *presentationLayer = helicopterImageView.layer.presentationLayer;
CGRect presentationRect = presentationLayer.frame;
CGRect birdRect = birdImageView.frame;
if (CGRectIntersectsRect(presentationRect, birdRect)){
NSLog(@"Collision");
birdImageView.hidden = YES;
[timer invalidate];
timer = nil;
}
}
UITableView 당겨서 업데이트 (0) | 2011.06.14 |
---|---|
모달 뷰 사용(일종의 팝업 윈도우) (1) | 2010.11.23 |
UIAlertView without Buttons - Please Wait Dialog (0) | 2010.07.21 |
MBProgressHUD (0) | 2010.07.21 |
UIBarButtonSystemItem 추가된 아이템 (0) | 2010.07.21 |
If you’ve ever wanted to show a simple “please wait” dialog without resorting to a custom view, UIAlertView is a good option, and is even more appropriate if you customize the alert such that no buttons are shown.
In the figure below you can see how a simple alert can be shown (sans buttons) while you are busy doing some other system activity (reading/writing files, etc).
UIAlertView *alert; ... alert = [[[UIAlertView alloc] initWithTitle:@"Configuring Preferences\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease]; [alert show];
Trouble with this approach is that things look a little lopsided, as there is a significant amount of dead space on the bottom where the button(s) are to be shown. We can fix this by adding a few newline characters at the start of our message:
UIAlertView *alert; ... // Add two newlines characters at the start of the message alert = [[[UIAlertView alloc] initWithTitle:@"\n\nConfiguring Preferences\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease]; [alert show];
The text is nearly centered, yet we’ve created a different problem, there is now white space on the top and bottom. There is one more approach…
In the whitespace on the bottom, let’s add an activity indicator. Also, remove the newlines in the message text so the text starts near the top:
UIAlertView *alert; ... alert = [[[UIAlertView alloc] initWithTitle:@"\n\nConfiguring Preferences\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease]; [alert show]; UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; // Adjust the indicator so it is up a few pixels from the bottom of the alert indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50); [indicator startAnimating]; [alert addSubview:indicator]; [indicator release];
Since there are no buttons associated with the alert, we have to dismiss the alert ourselves, versus the traditional approach where the system dismisses the alert when a button is pressed.
Here is the call to dismiss the alert:
[alert dismissWithClickedButtonIndex:0 animated:YES];
모달 뷰 사용(일종의 팝업 윈도우) (1) | 2010.11.23 |
---|---|
애니메이션 주기 (0) | 2010.11.10 |
MBProgressHUD (0) | 2010.07.21 |
UIBarButtonSystemItem 추가된 아이템 (0) | 2010.07.21 |
UIAlertView 커스터마이징 (0) | 2010.07.21 |