2010-08-05 29 views
3

我有一个tabbar应用程序。在其中一个选项卡中有一个按钮。 我想打开一个新的uiviewcontroller通过动画像弹出当我按下按钮。 popupviewcontroller有一个uiwebview。我想在弹出视图中显示一些网页。 我设计了IB中的popupview。如何打开一个新的uiview就像一个弹出?

我怎么能打开我的popupviewcontroller与动画像FBConnect。 FBconnect使用弹出式等动画打开登录对话框视图。

回答

8

你将不能像弹出的UIViewController一样打开。

对于您将不得不使用一个简单的UIView

UIView的(弹出形状等)添加到您的当前视图。

- (void) initPopUpView { 
    popup.alpha = 0; 
    popup.frame = CGRectMake (160, 240, 0, 0); 
    [self.view addSubview:popup]; 
} 

- (void) animatePopUpShow { 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:0.3]; 
    [UIView setAnimationDelegate:self]; 
    [UIView setAnimationWillStartSelector:@selector(initPopUpView)]; 

    popup.alpha = 1; 
    popup.frame = CGRectMake (20, 40, 300, 400); 

    [UIView commitAnimations]; 
} 
4

是的,你可以打开的样子弹出的窗口中你刚刚使用此代码并运行它.. 其打开很慢取决于你给定的时间...

可能会有所帮助

(void)popup 
{ 
    UIView *AView1=[[UIView alloc] initWithFrame:CGRectMake(self.view.frame.size.width/2,self.view.frame.size.height/2, 0, 0)]; 
    [AView1 setBackgroundColor:[UIColor redColor]]; 
    [UIView animateWithDuration:2.5 animations:^{AView1.frame = CGRectMake(35, 10, self.view.frame.size.width-70, self.view.frame.size.height-100);}]; 
} 
相关问题