'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
Posted by 독뽀
,

[기능]
- 카메라를 통한 사진 선택
- 롤 이미지에서 사진 선택
- 도큐먼트에 이미지 저장
- 새로 실행할때 도큐먼트 이미지 로드 기능

출처:
http://iamgsi.tistory.com/542
http://blueamor.tistory.com/786

'iOS > Skills' 카테고리의 다른 글

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
Posted by 독뽀
,

font 변경

iOS/Skills 2011. 6. 29. 14:04

iOS 3.2 부터 지원..

http://suigui.com/3017792
Posted by 독뽀
,

'iOS > Skills' 카테고리의 다른 글

아이폰 카메라 연동 소스  (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
Posted by 독뽀
,
UIImageView 는 UIImage 에 상관 없이 조절해도 되지만 객체로 갖고 있는 UIImage 크기는 변하지 않는다.

이미지 사이즈를 원하는 만큼 줄이는 방법

http://theeye.pe.kr/entry/how-to-resize-image-on-iPhone-development
Posted by 독뽀
,

'iOS > Skills' 카테고리의 다른 글

네비게이션 타이틀 글자 크기 조절  (0) 2011.06.20
UIImage 사이즈 변경하기  (0) 2011.06.15
UITableView 당겨서 업데이트  (0) 2011.06.14
모달 뷰 사용(일종의 팝업 윈도우)  (1) 2010.11.23
애니메이션 주기  (0) 2010.11.10
Posted by 독뽀
,
Posted by 독뽀
,

Modal의 뜻은 '양식이 있는, 모양의, 양식의' 이다.
'양식이 있는' 이라는 뜻에서 선택 사항이 있는 Alert와 통하는 부분도 있다.
그렇지만 모달은 더 많은 컨트롤러들을 제공한다.
ModalView 자체가 UIViewController의 서브클래스이기 때문에 일반적인 xib 파일의 사용이 가능하다.
임시로 뷰를 띄우고 선택 사항 값들을 닫음 혹은 어떤 액션과 동시에 임시 뷰를 없애는 용도 등에 많이 쓰인다.

모달 뷰를 띄울 클래스의 메서드에서..
ScoreboardModalView *modalView = [[ScoreboardModalView alloc] init];
[self presentModalViewController:modalView animated:YES];
}

ScoreboardModalView 에서 돌아가기 혹은 x 표시 등 자주 쓰이는 여러 액션들이 있을 것이다.
그 메서드에 들어갈 내용은 아래와 같다.

- (IBAction)goBack:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}

아래와 같이 전환 효과를 변경할 수도 있다.

[modalView setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:viewController animated:YES];

// UIModalTransitionStyleCoverVertical : 모달 뷰가 아래서 위로 덮으며 전환됩니다. (기본값)
//
UIModalTransitionStyleFlipHorizontal : 앞면의 부모 뷰가 회전되어 뒷면의 모달 뷰로 전환됩니다
// UIModalTransitionStyleCrossDissolve : 부모 뷰가 서서히 사라짐과 동시에 모달 뷰로 전환됩니다.

// UIModalTransitionStylePartialCurl : 부모 뷰가 종이처럼 휘어지며 모달 뷰로 전환됩니다.

[출처] iPhone SDK Tutorial 뷰를 모달로 띄우기

http://hyukmini.tistory.com/18?srchid=BR1http%3A%2F%2Fhyukmini.tistory.com%2F18
[출처] iOS의 다양한 뷰 전환 - 1. 모달 뷰 컨트롤러 전환과 효과

'iOS > Skills' 카테고리의 다른 글

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
Posted by 독뽀
,

애니메이션 주기

iOS/Skills 2010. 11. 10. 14:01


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;

    }

}


'iOS > Skills' 카테고리의 다른 글

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
Posted by 독뽀
,
원본: http://iphonedevelopertips.com/user-interface/uialertview-without-buttons-please-wait-dialog.html
출처: http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=7462&MAEULNO=911&no=52368&page=1

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 without Buttons
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…

UIAlertView with UIActivity Indicator

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];

Dismissing the Buttonless UIAlertView

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];

'iOS > Skills' 카테고리의 다른 글

모달 뷰 사용(일종의 팝업 윈도우)  (1) 2010.11.23
애니메이션 주기  (0) 2010.11.10
MBProgressHUD  (0) 2010.07.21
UIBarButtonSystemItem 추가된 아이템  (0) 2010.07.21
UIAlertView 커스터마이징  (0) 2010.07.21
Posted by 독뽀
,