现在我在 facebook 上发布屏幕截图。但我正在尝试定义屏幕截图高度。
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *imgPicture = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
if ([SLComposeViewController isAvailableForServiceType: SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller setInitialText :@"post from my iphone"];
[controller addURL:[NSURL URLWithString:@"https://www.facebook.com/birjesh.sharma.921"]];
//[controller addImage:[UIImage imageNamed:imgPicture]];
[controller addImage:imgPicture];
[self presentViewController: controller animated:YES completion:nil];
}