QLPreviewController navigationBar标题显示当前页码,如6之2,但我想将此标题更改为任何String,如当前文件名。
答案 0 :(得分:0)
尝试
let lblNavTitle = UILabel(frame: CGRect(x: 60, y: 10, width: view.frame.size.width-110, height: 20))
lblNavTitle?.textAlignment = .center
lblNavTitle?.lineBreakMode = .byTruncatingMiddle
lblNavTitle?.text = "File Name"
navigationItem.titleView = lblNavTitle
OR
只需将标题属性设置为
self.title = "File Name"
也许对您有用