【发布时间】:2020-10-30 20:34:29
【问题描述】:
我无法创建单独的自定义弹出视图..所以我尝试了下面提到的答案之一
这里是故事板视图层次结构
popBG view background colour is black with alpha = 0.3
这是代码:
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var popViewtop: UIView!
@IBOutlet weak var testTable: UITableView!
@IBOutlet weak var popView: UIView!
@IBOutlet weak var popBG: UIView!
override func viewDidLoad() {
super.viewDidLoad()
popViewtop.isHidden = true
}
@IBAction func testBtn(_ sender: Any) {
popViewtop.isHidden = false
}
@IBAction func btnPop(_ sender: Any) {
let viewController = self.storyboard?.instantiateViewController(withIdentifier: "NewZoomAddressViewController") as! NewZoomAddressViewController;
popViewtop.isHidden = true
self.navigationController?.pushViewController(viewController, animated: true);
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
}
现在 tableview 和按钮没有透明显示..只有 popbg 和 popview 来了..我错过了什么..
其实我需要这样的:在一些深色的总背景视图和以白色突出显示的弹出视图
【问题讨论】:
标签: ios swift xcode uiview uicolor