pushViewController在迅速3
问题描述:
不行我添加按钮,通过这个代码查看:pushViewController在迅速3
btnMarkerInfo.setImage(imgInfo, for: .normal)
btnMarkerInfo.setTitleColor(UIColor.white, for: .normal)
btnMarkerInfo.frame = CGRect(x: w, y: UIScreen.main.bounds.height-70-56, width: 56, height: 56)
btnMarkerInfo.addTarget(self, action: #selector(vcMain.markerDidTap(_:)), for: .touchUpInside)
btnMarkerInfo.isHidden = true
btnMarkerInfo.alpha = 0
self.view.addSubview(btnMarkerInfo)
markerDidTap()是在这里:
func markerDidTap(_ sender: UIButton){
let vcPointTitles = storyboard?.instantiateViewController(withIdentifier: "vcPointTitles") as! vcPointTitles
vcPointTitles.pointId = sender.tag
self.navigationController?.pushViewController(vcPointTitles, animated: false)
}
时,这个按钮的功能markerDidTap
运行和vcPointTitles
必须的用户水龙头显示,功能执行但vcPointTitles不显示。 类和storyBoardId设置类似如下: vcPointTitles如下定义:
class vcPointTitles: UIViewController, UITableViewDelegate, UITableViewDataSource { .... }
我怎样才能解决这一问题?
答
试试这个,但它的到来晚了,但是这可能是帮助他人面对这样
func markerDidTap(_ sender: UIButton){
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vcPointTitles =
storyBoard.instantiateViewController(withIdentifier: "vcPointTitles") as!
VCPointTitlesViewController
vcPointTitles.pointId = sender.tag
self.present(vcPointTitles, animated: true, completion: nil)
}
+0
您不是在NavigationController内部推送ViewController - 而是在展示它。 – moonvader
为什么你把一个模块iAtlas? –