IanMK2 Blog


헤더에 UINavigationController delegate와 UIImagePickerController Delegate를 추가하고
- (IBAction)getPhotos
{
UIImagePickerController *picker = [[[UIImagePickerController alloc]init] autorelease];
picker.delegate = self;
// picker.sourceType = UIImagePickerControllerSourceTypeCamera; //카메라로 찍어서 가져오기
// picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; //앨범에서 가져오기
[self presentModalViewController:picker animated:YES];
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
//img에 선택한사진
}


Posted by IanMK2

UIImageView * logoView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.jpg"]];
logoView.contentMode = UIViewContentModeScaleToFill;
logoView.frame = CGRectMake(0, 0, 320, 480);

[UIView beginAnimations:nil context:NULL];   //여기부터
[UIView setAnimationDuration:2.0];
[window addSubview:logoView];
[logoView setAlpha:0.0]; //알파값을 0 으로 바꾸므로 페이드아웃효과가 남
[UIView commitAnimations];  //여기사이에 프로퍼티를 변경하면 애니메이션효과가 나타난다.






Posted by IanMK2

UITextView *textView;
textView.font = [UIFont fontWithName:@"Helvetica" size:14.0];

빌더에서 프로퍼티에 없길래 찾았는데 메소드에 있었다.
Posted by IanMK2

헤더에 변수 및 프로퍼티 추가
UIActivityIndicatorView *spinner;
@property (nonatomic, retain) UIActivityIndicatorView *spinner;
 

써먹을땐
spniner = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[spinner setCenter:CGPointMake(160, 240)];
[self.view addSubview:spinner];
[spiner startAnimating];



없앨땐
[spiner stopAnimating];

 

Posted by IanMK2