[英]How to remove back button from scrollview in Xcode/Swift
I am trying to remove the automatically generated back button from my scrollview in Xcode. 我正在尝试从Xcode的滚动视图中删除自动生成的后退按钮。 Thanks. 谢谢。
You are using an UINavigationController
, the UIScrollView
not have any UINavigationBar
inside it. 您正在使用UINavigationController
,但UIScrollView
没有任何UINavigationBar
。 You need to set a normal UIViewController
or hide the back button in your UINavigationBar
in the following way: 您需要通过以下方式设置普通的UIViewController
或在UINavigationBar
中隐藏后退按钮:
self.navigationItem.setHidesBackButton(true, animated:true)
Or in this way : 或者以这种方式:
let backButton = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.Plain, target: navigationController, action: nil)
self.navigationItem.leftBarButtonItem = backButton
I hope this help you. 希望对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.