2011-09-26 47 views
6

我正在开发一个使用Facebbook图形API完成登录的iPad应用程序。我的应用程序支持横向模式。我已经集成了FBGraph API,但它不是以横向模式进入。请告诉我如何以横向模式显示我的Facebook登录视图。FBGraph API不会进入land scape模式

任何建议将不胜感激。

+2

谁在显示登录框?浏览器?一个应用程序?请求如何显示登录框? – DMCS

+0

要说清楚,它是以肖像方式工作,还是根本不工作? – Autonomy

+0

是的,它工作在肖像 – Gypsa

回答

1

如果您使用最新的here SDK,Facebook登录将在Safari或Faceebook应用程序中打开,或者直接从iOS 6设置中获取。它不会在我们的应用程序内打开登录窗口,并且没有定位问题。

0

现在用下面的方法,其工作的罚款。

在视图中使用以下代码,您将在其中使用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)]; 

    }