我用下面的代碼來捕捉整個屏幕的截圖,包括狀態欄和的TabBar:iOS9截圖沒有顯示的TabBar
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
[self.view drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:NO];
UIImage *imageNew = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(imageNew, nil, nil, nil);
它吸引了一切,除了狀態欄和的TabBar
我不知道什麼「自我」就在這裏,但我非常懷疑它包含狀態欄或標籤欄。它可能只是一個視圖控制器,因此self.view是視圖本身。 – Eiko
'self.view'是指主視圖,不是嗎? – Maysam
它指的是「自我」的觀點,無論如何。只有你知道。但它最有可能不是整個屏幕。 – Eiko