2012-01-31 104 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 
    } 
}