2012-01-31 96 views

回答

6

不,您無法在iOS上與沙箱以外的其他應用程序進行交互。

2

它的iOS默認值。如果您同時按下Home + Power按鈕,iOS設備將截屏並將截圖存儲在您的照片應用程序中。

+0

我不認爲他正在尋找讓用戶觸發這個。 – ceejayoz 2012-01-31 16:00:24

+0

我的想法是可能創建一個允許用戶能夠拍攝「屏幕視頻」的應用程序。我不認爲是可能的,但感謝你的答案。 – user1034642 2012-01-31 16:59:21

1

換句話說,你想窺探其他應用程序。就像用戶的銀行信息一樣。現在這個問題被重新解釋了,我敢打賭你知道答案(以及爲什麼即使提交功能請求也不會改變)。

+0

否。該應用程序將被用戶用來拍攝「屏幕視頻」,這些視頻將存儲到他們的照片應用程序中。不要窺探人們的銀行信息。 – user1034642 2012-01-31 17:27:55

+1

但是你需要概括你所要求的能力。如果iOS不讓你做某件事情,那很常見,因爲它可能太容易被濫用了。 – 2012-01-31 18:31:30

0
- (IBAction)saveScreenshot {   
    // Define the dimensions of the screenshot you want to take (the entire screen in this case) 
    CGSize size = [[UIScreen mainScreen] bounds].size; 

    // Create the screenshot 
    UIGraphicsBeginImageContext(size); 
    // Put everything in the current view into the screenshot 
    [[self.view layer] renderInContext:UIGraphicsGetCurrentContext()]; 
    // Save the current image context info into a UIImage 
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 
    UIGraphicsEndImageContext(); 

    // Save the screenshot to the device's photo album 
    UIImageWriteToSavedPhotosAlbum(newImage, self, 
            @selector(image:didFinishSavingWithError:contextInfo:), nil); 
} 

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { 

    if (error) { 
     // Handle if the image could not be saved to the photo album 
    } 
    else { 
     // The save was successful and all is well 
    } 
}