2013-05-20 42 views
0

我希望它能像这样流动我正在做它吨次和剂量的工作。

将图片排序到应用程序中的特定位置

  • 用户按压在该应用中的照片按钮和需要的画面。

  • 拍照后用户必须输入详细信息。排序选项出来,用户可以选择8种不同的默认流派,并且用户推送保存。

  • 回到主屏幕,用户可以看到按钮&中的8种不同类型,当推送的图片作为保存在应用程序中的封面流(封面)出现时。
    我想使它像上面的工作,但剂量的工作。

我的代码是到现在为止是:

@implementation ViewController 

-(IBAction)TakePhoto { 
picker = [[UIImagePickerController alloc]init]; 
picker.delegate = self; 
[picker setSourceType: UIImagePickerControllerSourceTypeCamera ]; 
[self presentViewController:picker animated:YES completion:NULL]; 
} 

-(IBAction)ChooseExisting{ 
picker2 = [[UIImagePickerController alloc]init]; 
picker2.delegate = self; 
[picker2 setSourceType: UIImagePickerControllerSourceTypePhotoLibrary]; 
[self presentViewController:picker2 animated:YES completion:NULL]; 
} 
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo: 
(NSDictionary *) info { 
image = [info objectForKey:UIImagePickerControllerOriginalImage] ; 
[imageview setImage:image]; 
[self dismissViewControllerAnimated:YES completion:NO]; 
} 
- (void) imagePickerControllerDidCancel:(UIImagePickerController *)picker{ 
[self dismissViewControllerAnimated:YES completion:NULL]; 
} 


@end 

@implementation CVCLCoverFlowLayout 
-(NSInteger)count { 
return [self.collectionView numberOfItemsInSection:0 ]; 
} 
-(CGSize)collectionViewContentSize{ 
CGSize size = self.collectionView.bounds.size; 
size.width = self.count * self.cellInterval; 
return size; 
} 
+0

那它不起作用呢?它做错了什么? – Wain

回答

0

你是不是节省您的委托功能单击图像。而当你想使用保存的图像,那么你需要记下代码相同:

- (无效)imagePickerController:(*的UIImagePickerController)选择器didFinishPickingMediaWithInfo: (NSDictionary的*)信息{

image = [info objectForKey:UIImagePickerControllerOriginalImage];

[imageview setImage:image];

/将图像保存到你的应用程序的本地存储/

[自dismissViewControllerAnimated:YES完成:NO];

} 您可以检查代码相同过来: http://dcraziee.wordpress.com/2013/05/20/how-to-save-and-get-image-from-cache-directory/

请分享博客,如果你喜欢它。

相关问题