2014-01-06 15 views
0

使用Xcode 5和适用于iOS7的开发如何捕获图像添加标题,然后将其存储在应用程序中以便在应用程序内的单独视图控制器上进行检索和显示。iOS7如何捕获图像并添加标题

我知道你设置这个代码

- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller 
      usingDelegate: (id <UIImagePickerControllerDelegate, 
           UINavigationControllerDelegate>) delegate { 

    if (([UIImagePickerController isSourceTypeAvailable: 
      UIImagePickerControllerSourceTypeCamera] == NO) 
     || (delegate == nil) 
     || (controller == nil)) 
     return NO; 


    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init]; 
    cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera; 

    // Displays a control that allows the user to choose picture or 
    // movie capture, if both are available: 
    cameraUI.mediaTypes = 
    [UIImagePickerController availableMediaTypesForSourceType: 
     UIImagePickerControllerSourceTypeCamera]; 

    // Hides the controls for moving & scaling pictures, or for 
    // trimming movies. To instead show the controls, use YES. 
    cameraUI.allowsEditing = NO; 

    cameraUI.delegate = delegate; 

    [controller presentModalViewController: cameraUI animated: YES]; 
    return YES; 
} 

但我怎么那么字幕的图像保存它检索另一个视图控制器上,会很感激的帮助。

回答

0

如果我没有错,在图像中添加标题的构建属性或API中没有。 首先,您必须在拍摄图像后使用UIImagePickerController拍摄图像,使用您的UIViewcontroller显示图像,并在其中添加标题,然后在保存后添加标题UITextfield

或者您可以使用Overlay属性UIImagePickerController您可以尝试使用它。

+0

非常感谢。我会放弃这一点。 – Nim

+0

@Nim:好的,如果它可以帮助你,你可以接受答案。 –