โปรดดูที่ภาพหน้าจอของฉัน ข้อความ "ด้านหลัง" สีน้ำเงินจะแสดงบน iphone plus เสมอ (6s plus, 7 plus สำหรับทั้งเครื่องจำลองและอุปกรณ์จริง) มันไม่แสดงบน iPhone หน้าจอเล็ก ฉันพยายามหลายวิธีในการซ่อน/เปลี่ยนแปลงจากคอนโทรลเลอร์ปัจจุบัน/ก่อนหน้า แต่ก็ไม่มีโชค
เหตุใดจึงใช้งานได้กับ iPhone ขนาดเล็กแต่ใช้ไม่ได้กับ iPhone รุ่นบวก
ใครสามารถช่วยฉันได้บ้าง:( ขอบคุณ
นี่คือรหัส:
@IBAction func filter(_ sender: Any) {
let view:FilterViewController = self.storyboard?.instantiateViewController(withIdentifier: "FilterViewController") as! FilterViewController
view.superVC = self
view.currentFilter = currentFilter
self.setLeftCloseNavigation()
self.navigationController?.pushViewController(view, animated: true)
}
func setLeftCloseNavigation(){
self.navigationController?.navigationBar.backgroundColor = UIColor.clear
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.layer.mask = nil
self.navigationController?.navigationBar.backIndicatorImage = UIImage(named: "icon_close")?.withRenderingMode(.alwaysOriginal)
self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = UIImage(named: "icon_close")?.withRenderingMode(.alwaysOriginal)
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
}
และนี่คือ viewDidLoad ในคอนโทรลเลอร์ที่ถูกพุช:
override func viewDidLoad() {
super.viewDidLoad()
statusBar = UIColor.black
setResetNavigation() }
func setResetNavigation(){
navigationItem.hidesBackButton = false
let skipButton = UIButton(frame: CGRect(x: 0, y: 0, width: 70, height: 30))
skipButton.setTitle("Reset all".localized(), for: .normal)
skipButton.setTitleColor(UIColor.black, for: .normal)
skipButton.titleLabel?.font = UIFont(name: "HJGothamMedium", size: 16)
skipButton.addTarget(self, action: #selector(resetAllClicked), for: .touchUpInside)
let skip = UIBarButtonItem(customView: skipButton)
navigationItem.rightBarButtonItem = skip
}
นี่คือลำดับชั้นการดู