ios - How to display sub view or button on top of Google maps Xcode -
i trying add button on top of google maps. tried no can me.. in xcode preview shows on top after running app come below google map.
picture after running app
how looks in xcode
code of map
import uikit import googlemaps  class homeviewcontroller: uiviewcontroller, cllocationmanagerdelegate {     @iboutlet weak var scrollview: uiscrollview!     @ibaction func refreshlocation(sender: anyobject) {         locationmanager.startupdatinglocation()      } @iboutlet weak var gmapview: gmsmapview!   let locationmanager = cllocationmanager()     override func viewdidload() {     super.viewdidload()     locationmanager.delegate = self     locationmanager.desiredaccuracy = kcllocationaccuracybestfornavigation     locationmanager.requestalwaysauthorization()   locationmanager.startupdatinglocation()     self.scrollview.contentsize=cgsizemake(320, 700)               let camera = gmscameraposition.camerawithlatitude(15.4989, longitude: 73.8278, zoom: 17)              gmapview.camera = camera             gmapview.mylocationenabled = true              self.view.addsubview(gmapview)             let marker = gmsmarker()              marker.map = self.gmapview  }  override func didreceivememorywarning() {     super.didreceivememorywarning() }  }  extension homeviewcontroller {     func locationmanager(manager: cllocationmanager, didchangeauthorizationstatus status: clauthorizationstatus) {         if status == clauthorizationstatus.authorizedalways {             locationmanager.startupdatinglocation()          gmapview.mylocationenabled = true          gmapview.settings.mylocationbutton = true     } } func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]) {     if let location = locations.first {         gmapview.camera = gmscameraposition(target: location.coordinate, zoom: 15, bearing: 0, viewingangle: 0)          locationmanager.stopupdatinglocation()      } }    }      
i found answer
self.view.bringsubviewtofront(self.view_name)   you need call bringsubviewtofront on parent view.


Comments
Post a Comment