3

我在这里使用此代码UIView Popup like UIAlertView创建 UIVIew 相同的 UIalertView。我从 UIViewController 推送新的 UIViewAlert,但我希望 UIViewAlert 出现,UIViewController 不点击或选择,然后 UIViewAlert 消失,UIVIewController 点击正常。在我的 ViewController 中有 1 个 tablview,1 个 tabbar 包括 4 个 UIButton。

我将新的 UIViewAlert 称为:

    DetailView *detailAlert = [[DetailView alloc] init];
    [self.view addSubview:detailAlert];
    [detailAlert show];
    [detailAlert release];

有人给我看看吗?谢谢

4

3 回答 3

1

您可以通过在启动警报视图之前添加一个来实现这一点,BLOCK SCREEN请参见下面的代码

self.blockView=[[UIView alloc] initWithFrame:self.view.frame];
self.blockView.backgroundColor = [UIColor blackColor];
self.blockView.alpha = .5;
self.blockView.userInteractionEnabled=NO;
[self.view addSubview:self.blockView];

DetailView *detailAlert = [[DetailView alloc] init];
[self.view addSubview:detailAlert];
[detailAlert show];
[detailAlert release];

然后,当您删除警报视图时,请执行以下操作

[self.blockView removeFromSuperview];
于 2013-07-19T06:36:36.117 回答
0

您可以使用弹出窗口显示您的 DetailView。

使用它进行演示。 https://github.com/martinjuhasz/MJPopupViewController

于 2013-07-19T07:22:16.147 回答
0

您可以创建一个颜色清晰的视图控制器并以模态方式呈现它,请参见下面的 Swift 2 示例:

private func TransparentViewController() -> UIViewController {
  let transparentViewController = UIViewController(nibName: nil, bundle: nil)
  transparentViewController.modalPresentationStyle = .OverCurrentContext
  transparentViewController.modalTransitionStyle = .CrossDissolve
  transparentViewController.view.backgroundColor = UIColor.clearColor()
  return transparentViewController
}

现在您可以在显示 HUD 之前从您的视图控制器中显示它:

let transparentViewController = TransparentViewController()
self.presentViewController(transparentViewController, animated:false, completion: nil) 
于 2015-09-15T06:42:42.317 回答