FBGraph API not coming in land scape mode
I am developing an iPad application in which Login is done using Facebbook graph API.My App supports landscape mode. I have integrated FBGraph API , bu开发者_JS百科t it is not coming in landscape mode.Please suggest me how to show my facebook login view in landscape mode.
Any suggestions would be highly appreciated.
If you use latest SDK from here, Facebook login will be opened in Safari or Faceebook app or will be fetched directly from iOS 6 Settings. It will not open login window inside our app, and there will be no orientation issue.
use the facebook sdk instead:
New facebook SDK
Am using the following method, and its working fine.
Use the following code in the view, in which you are going to use fbgraph.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
[self leftOrienation];
}
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
[self rightOrientation];
NSLog(@"right");
}
else
{
}
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
here i have initialized FbGraph as fbGraph.
-(void)leftOrienation
{
CGAffineTransform newTransform;
newTransform = CGAffineTransformMakeRotation(M_PI * 270 / 180.0f);
fbGraph.webView.transform = newTransform;
[fbGraph.webView setFrame:CGRectMake(0, 0, 768, 1024)];
}
-(void)rightOrientation
{
CGAffineTransform newTransform;
newTransform = CGAffineTransformMakeRotation(M_PI * 90 / 180.0f);
fbGraph.webView.transform = newTransform;
[fbGraph.webView setFrame:CGRectMake(0, 0, 768, 1024)];
}
精彩评论