2017-01-17 64 views
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) 
    } 
+0

在代碼中嘗試「bringSubviewToFront」。 – sourav

回答

0

如果設置上的腳本,然後所有的觀點都放在後面出於某種原因的MapView。

mapView = new MapView(View.Bounds); 
Background.InsertSubview(mapView, 0); 

因此,如果您以這種方式添加MapView,那麼您的視圖將保留在地圖前。唯一的問題是您將不得不處理設備方向取景。