向GMSMapView(Google Map)添加一些按钮并更改图片按钮

时间:2018-09-21 09:32:42

标签: ios button swift3 gmsmapview

我尝试但无法显示按钮

代码:

btnLokasiSaya = UIButton(frame: CGRect(x: 341, y: 28, width: 100, height: 30))
self.viewMap.addSubview(btnLokasiSaya)

StoryBoard:

enter image description here

输出:在仿真中找不到我的按钮

enter image description here

1 个答案:

答案 0 :(得分:4)

Main.Storyboard外部的mapview的添加按钮中,如下所示:

enter image description here