iOS自定义弹窗(UIView)
效果:
解决:
1. 先放一层 黑色 50%透明度的背景 , 再放弹窗,再在弹窗上放置自定义。
//================================================
//弹窗
//================================================
//中灰背景
UIView *alertBackView = [[UIView alloc] initWithFrame:parentView.frame];
alertBackView.backgroundColor = [UIColor colorWithHex:0x000000 alpha:0.5];
[parentView addSubview:alertBackView];
//弹窗
UIView *alertView = [[UIView alloc] initWithFrame:CGRectMake((parentView.width - kAlertViewWidth) / 2, (parentView.height - kAlertViewHeight) / 2, kAlertViewWidth, kAlertViewHeight)];
alertView.backgroundColor = [UIColor whiteColor];
al