实现弹出一个view,效果类似alertView

、、、

UIView *fullView = [[UIView alloc] init];//fullView是window上放置的view,作为superView
fullView.frame = self.view.bounds;
fullView.tag = kSLViewTypeFullView;//设置枚举表示view的类型(用来确定window上所加的那个view)
fullView.backgroundColor = [UIColor clearColor];
[self.view.window addSubview:fullView];
//blackView是暗黑色的背景view
UIView *blackView = [[UIView alloc] init];
blackView.frame = fullView.bounds;
blackView.backgroundColor = [UIColor blackColor];
blackView.alpha = 0.7;
[fullView addSubview:blackView];
//callUpView是自定义的view也就是显示的view
SLCallUpView *callUpView = [[SLCallUpView alloc] initWithFrame:CGRectMake(0, 0, 0.665 * fullView.width, 120)];
callUpView.center = fullView.center;
callUpView.phoneNumString = phoneStr;
[callUpView loadData];
callUpView.delegate = self;
callUpView.alpha = 1;
[fullView addSubview:callUpView];

、、、

移除的方法

、、、
[[self.view.window viewWithTag:kSLViewTypeFullView]removeFromSuperview];
、、、

实现弹出一个view,效果类似alertView_第1张图片
屏幕快照 2015-12-14 上午2.15.53_meitu_1.jpg

)

你可能感兴趣的:(实现弹出一个view,效果类似alertView)