How to add a button on the Google maps in iOS?

后端 未结 5 2076
北海茫月
北海茫月 2021-02-05 16:44

I am new to iOS Programming and I have downloaded the google maps sdk for iOS and followed the instruction on their website ( as shown in this link https://developers.google.com

5条回答
  •  [愿得一人]
    2021-02-05 17:27

     let mapButton:UIButton = UIButton(frame: CGRect(x:self.view.bounds.width-50, y: 20, width: 40, height: 40)) //Swfit 5
        mapButton.backgroundColor = UIColor.clear
        mapButton.setImage(UIImage(named: "list"), for: UIControl.State.normal)
        mapButton.setImage(UIImage(named: "map"), for: UIControl.State.selected)
        mapButton.addTarget(self, action:#selector(self.mapListClicked), for: .touchUpInside)
        self.view.addSubview(mapButton)
    

提交回复
热议问题