3

I use this code at here UIView Popup like UIAlertView to create UIVIew same UIalertView. I push new UIViewAlert from UIViewController, but i want UIViewAlert appear, UIViewController not tap or select, and then UIViewAlert disappear, UIVIewController tap normal. In my ViewController has 1 tablview, 1 tabbar include 4 UIButton.

I called new UIViewAlert as:

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

Anybody show me? Thanks

Community
  • 1
  • 1
HTKT611
  • 161
  • 1
  • 1
  • 11

3 Answers3

1

You can achieve this by adding a BLOCK SCREEN before your alertview is launched see the code below

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];

Then when you remove your alertview do the following

[self.blockView removeFromSuperview];
iphonic
  • 12,615
  • 7
  • 60
  • 107
0

You can Display your DetailView with popup.

use this for demo. https://github.com/martinjuhasz/MJPopupViewController

ChandreshKanetiya
  • 2,414
  • 5
  • 27
  • 41
0

You could create a clear-colored view controller and presented it modally, see example below for 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
}

And now you can present it from within your view controller, before presenting the HUD:

let transparentViewController = TransparentViewController()
self.presentViewController(transparentViewController, animated:false, completion: nil) 
Zorayr
  • 23,770
  • 8
  • 136
  • 129