2014-01-06 17 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:好的,如果它可以幫助你,你可以接受答案。 –