0
我在我的iOS應用程序中使用Google Map iOS SDK實現了全屏地圖。有滑動菜單面板,從底部滑動。它只是一個帶按鈕的UIView。它工作正常,直到我開始與地圖交互。當移動攝像頭 - 我的擴展菜單視圖變得不可見。所以我需要再次點擊菜單按鈕來摺疊它,然後點擊另一個再次展開它。有沒有辦法讓UIView始終位於視圖堆棧之上?擴大和摺疊菜單iOS谷歌地圖查看遺址我的設計
代碼:
@IBAction func menuButtonClicked(sender: AnyObject) {
let animation = {() -> Void in
self.bottomMenu.frame.origin.y = UIScreen.main.bounds.size.height -
self.bottomMenu.frame.size.height
}
UIView.animate(withDuration: 0.25, animations: animation)
}
@IBAction func dropDownMenuButtonClicked(sender: AnyObject) {
let animation = {() -> Void in
self.bottomMenu.frame.origin.y = UIScreen.main.bounds.size.height
}
UIView.animate(withDuration: 0.25, animations: animation)
}
在代碼中嘗試「bringSubviewToFront」。 – sourav