当前控制器A的标题过长,push到下一个控制器B的时候发现B的标题靠右了,无法居中显示了,可以采用如下方法解决:
override funcviewWillAppear(animated:Bool) {
super.viewWillAppear(animated)
self.title="A控制器标题"
}
overridefuncviewWillDisappear(animated:Bool) {
super.viewWillDisappear(animated)
self.title=""
}
网友评论